Have an idea?

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

Display previous question answer from a grid

Hi,

I'm trying to display previous question answer in a question text, but the problem is that the previous question is grid format.

So I have 3 sentence and answer options agree strongly, agree, disagree and disagree strongly.
And I would like to display all the sentences in next question text if the respondent has strongly agreed or agreed with the sentence.

Is it possible to  add any conditions in  [%Label(Q1_r1)%] , or is there any other solution for this?

Thank you in advance!

Rosa
asked Jan 12 by Rosa

1 Answer

+1 vote
I'm doing some guessing here.

I have assumed you have a row direction grid called Q1 with 3 row items. Each row item requires a rating and an O/E question to be answered.

You then want to display the 3 O/E's from Q1 in the next questions' question script only if they have mentioned "agreed strongly" (I have assumed this is a code 1) or "agreed" (I have assumed this is a code 2)).

You can use some Perl script for each of the 3 Q1 row items as such ...

Q1 row item 1
[%Begin Unverified Perl 

 my $Q1Text1="";

 if((VALUE("Q1_r1_c1")==1) || (VALUE("Q1_r1_c1")==2))
  {  
   $Q1Text1=VALUE("Q1_r1_c2");
  }   
 
 return $Q1Text1;
 
End Unverified%]

Q1 row item 2
[%Begin Unverified Perl 

 my $Q1Text2="";

 if((VALUE("Q1_r2_c1")==1) || (VALUE("Q1_r2_c1")==2))
  {  
   $Q1Text2=VALUE("Q1_r2_c2");
  }   
 
 return $Q1Text2;
 
End Unverified%]

Q1 row item 3
[%Begin Unverified Perl 

 my $Q1Text3="";

 if((VALUE("Q1_r3_c1")==1) || (VALUE("Q1_r3_c1")==2))
  {  
   $Q1Text3=VALUE("Q1_r3_c2");
  }   
 
 return $Q1Text3;
 
End Unverified%]

The 3 O/E's from Q1 will only be displayed if the respondent has answered Q1=1 or 2 respectively.

I'm not sure where you want to display these Q1 O/E's within your question script so you can copy and paste each individual script where necessary.

I may not have your question numbers correct so please change them to your respective question numbers.
answered Jan 12 by Paul Moon Platinum (61,560 points)
edited Jan 12 by Paul Moon
...