Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Using Quota function to Remove from a constructed list


Here's my scenario....

I have a quota that contains two items.  Swiss cheese (n=20) and Cheddar Cheese (n=20).  The list is being built off of a constructed list.  They are to pick one or the other...

Is there a way once the quota is full, to remove one of these from the constructed list?

I'm struggling in how to do this. Would I write a perl instruction or use the QuotaCompletes function? I'm not sure.

Please let me know the instruction I would use or the function.
Thank you.
asked May 20 by anonymous

1 Answer

0 votes
I would use the functions IsQuotaCellOpen and Remove.  This constructed list instruction will add all items from the parent list, then remove the first or second items if their respective quota cells are full:

Begin Unverified Perl
if (!ISQUOTACELLOPEN('QuotaQ', 1)) {
    REMOVE('list1', 1);
if (!ISQUOTACELLOPEN('QuotaQ', 2)) {
    REMOVE('list1', 2);
End Unverified

Of course, "QuotaQ" and "list1" must be replaced with the names of the quota question and parent list, respectively.
answered May 20 by Zachary Platinum Sawtooth Software, Inc. (129,350 points)
Thank you.

Also, do you know what function I would use to skip off of a quota?  Say Swiss is full, but I still want it to ask the string cheese section, how do I do that?  If (SwissQuota is full) skip to StringCheese?

What function would work for that?