Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

display multiple values on if condition

  • bajpai
  • bajpai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 9 months 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! 
The topic has been locked.
  • bajpai
  • bajpai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 9 months ago #217019 by bajpai
Replied by bajpai on topic display multiple values on if condition
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))}
The topic has been locked.
  • bajpai
  • bajpai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 9 months ago #217020 by bajpai
Replied by bajpai on topic display multiple values on if condition
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?
The topic has been locked.
  • bajpai
  • bajpai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 9 months ago #217023 by bajpai
Replied by bajpai on topic display multiple values on if condition
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%]
 
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #217027 by holch
Replied by holch on topic display multiple values on if condition
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.

The topic has been locked.
  • bajpai
  • bajpai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 9 months ago #217041 by bajpai
Replied by bajpai on topic display multiple values on if condition
Thank you, sure. I will keep that in mind.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose