Have an idea?

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

Constructed grid question - transposition column list -> row list

Dear All,

I would appreciate for a help in a below problem.

I got row based single select grid question with brands (rows) and service options (columns).
There are 36 brands and 5 service options as below :
Q13CR

                   Service opt1    Service opt2    Service opt3   Service opt4      Service opt5
Brand 1     Q13CR_r1=1    Q13CR_r1=2    Q13CR_r1=3    Q13CR_r1=4    Q13CR_r1=5
Brand 2            Q13CR_r2=1    Q13CR_r2=2       Q13CR_r2=3    Q13CR_r2=4    Q13CR_r2=5
Brand 3          Q13CR_r3=1           Q13CR_r3=2    Q13CR_r3=3     Q13CR_r3=4      Q13CR_r3=5
Brand 4         Q13CR_r4=1           Q13CR_r4=2    Q13CR_r4=3      Q13CR_r4=4    Q13CR_r4=5
Brand …                   
Brand 36    Q13CR_r36=1    Q13CR_r36=2    Q13CR_r36=3    Q13CR_r36=4    Q13CR_r36=5

Then in Q13c I would like to ask for respondents satisfaction of these service options which were selected with any brand.
Q13c is as well grid based where rows are selected service options and columns 4 levels of satisfation so it should look as below :

Q13c

                        Extremely satisfied    Satisfied    Dissatisfied          Extremely dissatisfied
Service opt 1               
Service opt 2               
Service opt 3               
Service opt 4               
Service opt 5   
       

It is  not necessary to remind brand in Q13c - if only one any service option is selected in Q13CR then it should be called in Q13c.

I tried below code for Q13c (constructed question)

Begin Unverified Perl  

my $i=1;
for($i=1; $i<=36; $i++)
 {

 if(VALUE("Q13CR_r".$i.) ==1)  
 { ADD("Q13ColList",1); }

 if(VALUE("Q13CR_r".$i.) ==2)  
 { ADD("Q13ColList",2); }

 if(VALUE("Q13CR_r".$i.) ==3)  
 { ADD("Q13ColList",3); }

 if(VALUE("Q13CR_r".$i.) ==4)  
 { ADD("Q13ColList",4); }

 if(VALUE("Q13CR_r".$i.) ==5)  
 { ADD("Q13ColList",5); }

}

End Unverified 


But it doesn't work.
Anybody got any idea how to solve this problem ?

Thank you!
Robert
asked Jun 30, 2014 by robson Bronze (595 points)
retagged Jun 30, 2014 by Walter Williams

1 Answer

+1 vote
Robert, I just ran a similar test and got it working okay. I used a similar constructed list to yours. After carefully reviewing your code, I could see your problem.

Your incorrect code ...
 if(VALUE("Q13CR_r".$i.) ==1)  
 { ADD("Q13ColList",1); }

Corrected code ...
 if(VALUE("Q13CR_r".$i) ==1)  
 { ADD("Q13ColList",1); }

Remove the full stop after each "$i" within the VALUE function. There are 5 you need to correct.

Good luck.
answered Jul 1, 2014 by Paul Moon Platinum (63,820 points)
Thank you Paul ! Now it works.
You are a gem of this forum.
...