- Posts: 10
- Thank you received: 4
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Count radio list answers and display boilerplate text
- SIMOON
- Topic Author
- Offline
- New Member
Less
More
7 years 5 months ago #142919
by SIMOON
Count radio list answers and display boilerplate text was created by SIMOON
I think
this link
can help.
I never used it but in your case, it should be something like:
Note than I just used the condition in the example you linked, just use your own. ->if([condition1] > [condition2],"you chose option 1 more...","");
I never used it but in your case, it should be something like:
Code:
if(sum(if(Q01==1,1,0), if(Q02==1,1,0), if(Q03==1,1,0))>sum(if(Q01==2,1,0), if(Q02==2,1,0), if(Q03==2,1,0)),"You chose option 1 more then option 2","")
Note than I just used the condition in the example you linked, just use your own. ->if([condition1] > [condition2],"you chose option 1 more...","");
The following user(s) said Thank You: Antonimo
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
7 years 5 months ago #142929
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Count radio list answers and display boilerplate text
I would simplify it by using 2 hidden equation questions (let's call them equation1 and equation2) to record the counts of "Option 1" and "Option 2". Something like this in those questions:
Then, you can use something like this in the boilerplate:
Sample survey attached.
Code:
{sum(Q1=='A1', Q2=='A1', Q3=='A1', Q4=='A1', Q5=='A1')}
Code:
{sum(Q1=='A2', Q2=='A2', Q3=='A2', Q4=='A2', Q5=='A2')}
Then, you can use something like this in the boilerplate:
Code:
{if(equation1 > equation2, 'You answered "Option 1" more than "Option 2"', 'You answered "Option 2" more than "Option 1"')}
Sample survey attached.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: Antonimo
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12713
- Thank you received: 3926
7 years 2 weeks ago #149462
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Count radio list answers and display boilerplate text
Hi, Antonimo,
You see that it is displayed "group by group".
So this relevance avoids the display of the boilerplate until all 5 questions are answered.
Otherwise it would show up after the first question is answered, because the condition "equation1 > equation2" might be true.
Best regards
Joffm
You see that it is displayed "group by group".
So this relevance avoids the display of the boilerplate until all 5 questions are answered.
Otherwise it would show up after the first question is answered, because the condition "equation1 > equation2" might be true.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner
The topic has been locked.