Welcome to the LimeSurvey Community Forum

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

Expression Manager Help

  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 10 months ago #109727 by dweisser
Expression Manager Help was created by dweisser
I need to know the count of how many subquestions were clicked in a Multiple choice question.
I need to store this value in a separate question.

I tried: {count(that.q1.NAOK)>0} and {sum(that.q2.NAOK)} this but I can't get a number. The multiple choice questions if clicked evaluate to "Y".

If I have seven subquestions and all seven are clicked, I want to be able to store and use the value "7" in another context.

Anyone have any ideas? Thanks,
David
The topic has been locked.
More
10 years 10 months ago - 10 years 10 months ago #109732 by Ben_V
Replied by Ben_V on topic Expression Manager Help
Sometimes simple is the best ;)

All options checked:
Code:
{count(that.q1)}

Count + tailor a message (e.g.: singular/plural):
Code:
{count(that.q1)} if(count(that.q1)<2,'checkbox checked','checkboxes checked')}

.NAOK suffix is unnecessary for always relevant questions; Obviously, you can add it to your expression if needed.

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 10 years 10 months ago by Ben_V.
The topic has been locked.
  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 10 months ago #109752 by dweisser
Replied by dweisser on topic Expression Manager Help
That completely works. Oh - THANK YOU!
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose