display multiple values on if condition

More
3 months 1 week ago #217018 by bajpai
Hi,

I have a table in LimeSurvey question text, where I have to show all the 5 sub-question values (A1, A2, A3, A4, A5) along with the sub-question text of a array(number) question L42024PriceA_Q1, highlighted below in yelllow, on a condition.

Condition is :
if the random value generated(random1_SQ001) is equal to 1, then show all 10 values, the 5 fixed as subquestion text 
 
and other 5 filled in by respondent as L42024PriceA_Q1_A1, L42024PriceA_Q1_A2, L42024PriceA_Q1_A3, L42024PriceA_Q1_A4 and L42024PriceA_Q1_A5
 
the issue is applying the IF condition :
I can only show one of those values in the following syntax:
{if((random1_SQ001==1),L42024PriceA_Q1_A1.shown)} - this works 

Do you know what would be the syntax to show all 5 values?

{(if((random1part3gp1==1),L42024PriceA_Q1_A1.shown))L42024PriceA_Q1_A2.shown,L42024PriceA_Q1_A3.shown, L42024PriceA_Q1_A4.shown, L42024PriceA_Q1_A5.shown}  - this does not work

thank you! 
Attachments:

Please Log in to join the conversation.

More
3 months 1 week ago #217019 by bajpai
I resolved the condition with following code:

{if(((R1_SQ001==1) OR (R1_SQ002==1)),(L42024PriceA_Q1_A1.shown, L42024PriceA_Q1_A2.shown,L42024PriceA_Q1_A3.shown,L42024PriceA_Q1_A4.shown,L42024PriceA_Q1_A5.shown))}

Please Log in to join the conversation.

More
3 months 1 week ago #217020 by bajpai
but now my question is how can I display the subquestion text too along with the answers entered by respondent :
 

What would be the syntax for that?
Attachments:

Please Log in to join the conversation.

More
3 months 1 week ago #217023 by bajpai
If I do L42024PriceA_Q1_A1.question

then it displays the entire question text and then the sub- question heading.
the Probability of Vehicle Price (incl. VAT) relative to similar manual trucks[+10%]
 

I only want to show the subquestion code i.e. [10%]
 
Attachments:

Please Log in to join the conversation.

More
3 months 1 week ago #217027 by holch
Please do not open various questions for the same thing.

Try using ".shown" instead of ".question" and see what happens.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

More
3 months 1 week ago #217041 by bajpai
Thank you, sure. I will keep that in mind.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now