Have an idea?

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

Skip based on ListLength

I have  a grid question with two columns. If respondent selects only one option in both the column then I should skip specific HTML Intro text for a question.

I used the below code in skip condition and it is not working. Am I wrong with syntax.

ListLength(Q11_C1)=1 AND ListLength(Q11_C2)=1
asked Nov 22, 2013 by anonymous

2 Answers

+3 votes
I assume this is a multiple select col type grid as you can anyway select single answer only in radio select col type grid.

You can use:



NumChecked(Q11_C1)=1 AND NumChecked(Q11_C2)=1
answered Nov 23, 2013 by Saurabh Aggarwal Gold (29,615 points)
+1 vote
The ListLength function refers to a list, not a question.

You can add to a constructed list (or lists) and use the ListLength function within skips.

I'm not sure of your grid format (is it single or multiple response) but I'll give you an example ...

Q11Col1List (assume 5 possible answers in a multiple response grid with 2 columns) ...

Begin Unverified Perl

my $i=1;

for ($i=1; $i<=5; $i++)
 {
  if (VALUE("Q11_r".$i."_c1")==1)
   {
    ADD("Q11RowList",$i);
   }
 }

End Unverified 


Q11Col2List ...

Begin Unverified Perl

my $i=1;

for ($i=1; $i<=5; $i++)
 {
  if (VALUE("Q11_r".$i."_c2")==1)
   {
    ADD("Q11RowList",$i);
   }
 }

End Unverified 


Now you can use the conditions as such ...

ListLength(Q11Col1List)>1 and ListLength(Q11Col2List)>1 then stay at next question.
answered Nov 23, 2013 by Paul Moon Platinum (65,130 points)
...