Welcome to the LimeSurvey Community Forum

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

Counting number of Yes in array question

  • Salini
  • Salini's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 6 months ago #206217 by Salini
Hello,

I have a survey where a question depend on the number of "Yes" in the previous array question. That is if I have 2 or more yes among the list of attributes, then we need to ask the next question.

Do you know how to this?

Thank a lot for your help.
Salini
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago #206220 by DenisChenu
Replied by DenisChenu on topic Counting number of Yes in array question
The easiest to undertand solution , if your array question have ARRAY title and your subquestion have SQ01, SQ01, SQ023 title, adn, yopur code for Yes is Yes

Relevance equation to
Code:
count(ARRAY_SQ01.NAOK=="Yes",ARRAY_SQ02.NAOK=="Yes",ARRAY_SQ03.NAOK=="Yes",ARRAY_SQ04.NAOK=="Yes") >= 2

Bit you can use countifop too
Code:
countifop(">=",3,that.ARRAY.NAOK) > 0
(you don't really need the > 0

See manual : manual.limesurvey.org/ExpressionScript_E..._-_Quick_start_guide


Best is to explain exactly all you want with current code …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: Salini
The topic has been locked.
  • Salini
  • Salini's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 6 months ago #206222 by Salini
Replied by Salini on topic Counting number of Yes in array question
Dear DenisChenu,

Thank you for your reply.
Let me me try your solutions and check the manual link you sent.

Thanks again,
Salini
The topic has been locked.
  • Salini
  • Salini's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 6 months ago #206337 by Salini
Replied by Salini on topic Counting number of Yes in array question
Hello DenisChenu,

Thank you for your solution.
It's working perfectly with slight modifications to adapt to my survey.

Cheers,
Salini
The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose