Welcome to the LimeSurvey Community Forum

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

Count selected options in several questions to validate the last question

  • fishfree
  • fishfree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #184554 by fishfree
3 multiple choice questions are in the same group, question codes are : youths(4 options), leaders(3 options), others(7 options), I want to validate if the count of selected options in the 3 questions greater than or equal to 5. So in the last question, i.e. others, I fill in the "Question validation equation" as below:
Code:
(1) and (count(youth_SQ001.NAOK, youth_SQ002.NAOK, youth_SQ003.NAOK, youth_SQ004.NAOK, leaders_SQ001.NAOK, leaders_SQ002.NAOK, leaders_SQ003.NAOK, others_SQ001.NAOK, others_SQ002.NAOK, others_SQ003.NAOK, others_SQ004.NAOK, others_SQ005.NAOK, others_SQ006.NAOK, others_SQ007.NAOK) <= (5))

But it didn't work. No validation triggered against my custom logic.
The topic has been locked.
More
4 years 11 months ago #184559 by jelo
You should state what version of LimeSurvey you use and provide an lss-export of just these questions you want to discuss.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 11 months ago #184568 by Joffm
There is nearly the same question in the German part.

(1) and (count(youth_SQ001.NAOK, youth_SQ002.NAOK, youth_SQ003.NAOK, youth_SQ004.NAOK, leaders_SQ001.NAOK, leaders_SQ002.NAOK, leaders_SQ003.NAOK, others_SQ001.NAOK, others_SQ002.NAOK, others_SQ003.NAOK, others_SQ004.NAOK, others_SQ005.NAOK, others_SQ006.NAOK, others_SQ007.NAOK) <= (5))
This looks a bit strange. Did you enter exactly this?
Seems to be something of the logic file, but not everything.


sum(count(that.youth),count(that.leaders),count(that.others))<6
works (from 2.06 - 3.17.3)

Example with max. 4 answers:

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: fishfree
The topic has been locked.
  • fishfree
  • fishfree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #184595 by fishfree
Thank you for perfectly solving my problem! I mistook exactly inputting that expression according the logic file containing minimum validation in other fields.
The topic has been locked.
  • fishfree
  • fishfree's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 11 months ago #184598 by fishfree
Sorry, I find it not working as expected. In which question do you input the validation expression?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose