- Posts: 5
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
More
4 years 11 months ago #184554
by fishfree
Count selected options in several questions to validate the last question was created 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:
But it didn't work. No validation triggered against my custom logic.
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.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
4 years 11 months ago #184559
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Count selected options in several questions to validate the last question
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
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
4 years 11 months ago #184568
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Count selected options in several questions to validate the last question
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
(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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
4 years 11 months ago #184595
by fishfree
Replied by fishfree on topic Count selected options in several questions to validate the last question
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
4 years 11 months ago #184598
by fishfree
Replied by fishfree on topic Count selected options in several questions to validate the last question
Sorry, I find it not working as expected. In which question do you input the validation expression?
The topic has been locked.