Welcome to the LimeSurvey Community Forum

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

Sum of the values of a questionnaire as a condition

  • nmicheli
  • nmicheli's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 5 months ago #208417 by nmicheli
Hi everyone,

I have created a Array question with 15 questions and 3 answer options possible (code 1 : never, code 2 : sometimes, code 3: always).

I want that if the sum of these question is equal of more than 10, then one other question will appear.

I have created a equation hidden question but I don't understand how to go forward from here.

sum(SOM_A1.value, SOM_A2.value, SOM_A3.value, SOM_A4.value, SOM_A5.value, SOM_A6.value, SOM_A7.value, SOM_A8.value, SOM_A9.value, SOM_A10.value, SOM_A11.value, SOM_A12.value, SOM_A13.value, SOM_A14.value, SOM_A15.value)

Can I set this equation question as a condition (if this sum is more than 10)?

Thank you all
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208424 by Joffm
Hi,
what do you use for your sum?
Assessment values or codes?
Your example sums assessment values, as you read here
manual.limesurvey.org/ExpressionScript_-...#Access_to_variables

But I think you want to sum the codes
And having read this
manual.limesurvey.org/ExpressionScript_-...#.22That.22_variable

you just have (if you want to sum ALL subquestions of SOM.
{sum(that.SOM.NAOK)}
I hope it was a typo that you forgot the curly brackets.

Well, this question of type equation has a code, e.g. "eqSUM".
Now you can use this in your survey as each other variable.
Like: eqSUM gt10 as relevance equation
or: In the previous question you received {eqSUM} points.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose