Expression Manager Help

More
4 years 4 months ago #109727 by dweisser
dweisser created the topic: Expression Manager Help
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

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago - 4 years 4 months ago #109732 by Ben_V
Ben_V replied the topic: Expression Manager Help
Sometimes simple is the best ;)

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

Count + tailor a message (e.g.: singular/plural):
{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: 4 years 4 months ago by Ben_V.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #109752 by dweisser
dweisser replied the topic: Expression Manager Help
That completely works. Oh - THANK YOU!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!