Have an idea?

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

How to combine previous 2 responses into 1 member of a constructed list?

Hello,

I have a grid question #3 where I list 9 brands and ask the respondent what percent of the time they've used each of the brands.  
1) Peanut M&Ms
2) Plain M&Ms
3-9) etc...

For the next question #4 I want to call back their response to q3 and ask them their satisfaction rating for each of the 9 brands they've tried. I started a constructed list with the ANE to 0 function and it seems to work fine.

However, since 2 of the brands are from the same company and I only want to show it once, e.g.
1) M&Ms
2-8) etc...

What is the instruction for the constructed list so that if they choose either 1 and / or 2 in question #3 they will see this answer choice in the follow-up question #4?
asked Nov 2, 2021 by Rick

1 Answer

+1 vote
 
Best answer
It sounds like you will need a different list that is just the brands and not the products.  You would then need to use unverified perl to add the items from that new list based on the response to Q3.  So in the example below, if item 1 or item 2 is selected I'm adding the first item from your 'newlist' which would be M&Ms.  Then if item 3 is selected I'm adding item 2 which is the next brand.  And so on...

Begin Unverified Perl

if (VALUE("Q3_1")==1 || VALUE("Q3_2")==1)
{ADD("NewList",1);}

if (VALUE("Q3_3")==1)
{ADD("NewList",2);}

if (VALUE("Q3_4")==1)
{ADD("NewList",3);}
End Unverified
answered Nov 2, 2021 by Jay Rutherford Platinum (50,145 points)
selected Nov 3, 2021 by Bahadir Ozkurt
Also tried this as a workaround but no dice.

Begin Unverified Perl

if (VALUE("Q25CSFDrainageHoleDistan_r1_c1") > 0 || VALUE("Q25CSFDrainageHoleDistan_r1_c2") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r1_c3") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r1_c4") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r1_c5") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r1_c6") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r1_c7") > 0)
{ADD("NewListQ26NEW",1);}

if (VALUE("Q25CSFDrainageHoleDistan_r2_c1") > 0 || VALUE("Q25CSFDrainageHoleDistan_r2_c2") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r2_c3") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r2_c4") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r2_c5") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r2_c6") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r2_c7") > 0)
{ADD("NewListQ26NEW",2);}

if (VALUE("Q25CSFDrainageHoleDistan_r3_c1") > 0 || VALUE("Q25CSFDrainageHoleDistan_r3_c2") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r3_c3") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r3_c4") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r3_c5") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r3_c6") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r3_c7") > 0)
{ADD("NewListQ26NEW",3);}

if (VALUE("Q25CSFDrainageHoleDistan_r4_c1") > 0 || VALUE("Q25CSFDrainageHoleDistan_r4_c2") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r4_c3") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r4_c4") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r4_c5") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r4_c6") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r4_c7") > 0)
{ADD("NewListQ26NEW",4);}


if (VALUE("Q25CSFDrainageHoleDistan_r5_c1") > 0 || VALUE("Q25CSFDrainageHoleDistan_r5_c2") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r5_c3") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r5_c4") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r5_c5") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r5_c6") > 0 || 
VALUE("Q25CSFDrainageHoleDistan_r5_c7") > 0)
{ADD("NewListQ26NEW",5);}
End Unverified
I'd need a little more understanding of the structure.  Is the original grid question row based or column based in the direction of responses?  You indicated it was a grid select question.  Is it a single response or multiple response?  It would seem that it's probably row based and you are capturing a response (or responses) for each row item?  The only reason we went with a new predefined list in our previous discussion was you wanted to treat 2 different items as 1 item so it required us to taking a different route.  This one should be a bit more straight-forward once I understand the layout better.
Sure, so you are correct it's row based single response. Basically a rating scale 1 through 7 up top and 4 rows to be rated plus a 5th "other" row.
Okay, this should be pretty easy then.  Use your rowlist from Q25CSFDrainageHoleDistan as the parent list for a new constructed list.  Your logic for your constructed list will simply be this:

AIG (Q25CSFDrainageHoleDistan,0)

That's it.  We are adding any item from that rowlist if the value at that question is greater than 0.
Thanks got it!
...