- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to restrict number of times a column in array can be selected?
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
1 year 10 months ago - 1 year 10 months ago #228057
by blocka
How to restrict number of times a column in array can be selected? was created by blocka
Your LimeSurvey version: 3.28.9+220503
Own server or LimeSurvey hosting: Own
Survey theme/template: vanilla
==================
I have an Array type question (QArray), which has 5 columns with the answer codes 1 through 5.
I want to restrict the total number of responses to the column with the answer code "5" to 3 -- that is, no more than 3 options can be rated "5". The sub-questions are coded 1 through 15.
Another way to explain it, column 5 in my array has the heading "High Priority" and then the guidance I give the respondent is: A maximum of 5 responses may be selected as “High Priority” -- and I want to enforce this so that no more than 5 rows can be marked as "high priority"...
Is there a way to do this?
Own server or LimeSurvey hosting: Own
Survey theme/template: vanilla
==================
I have an Array type question (QArray), which has 5 columns with the answer codes 1 through 5.
I want to restrict the total number of responses to the column with the answer code "5" to 3 -- that is, no more than 3 options can be rated "5". The sub-questions are coded 1 through 15.
Another way to explain it, column 5 in my array has the heading "High Priority" and then the guidance I give the respondent is: A maximum of 5 responses may be selected as “High Priority” -- and I want to enforce this so that no more than 5 rows can be marked as "high priority"...
Is there a way to do this?
Last edit: 1 year 10 months ago by blocka.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12789
- Thank you received: 3940
1 year 10 months ago - 1 year 10 months ago #228059
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to restrict number of times a column in array can be selected?
I should say:
validate like
countif("5",self)<4
validate like
countif("5",self)<4
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 10 months ago by Joffm.
Please Log in to join the conversation.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
1 year 10 months ago #228060
by blocka
Replied by blocka on topic How to restrict number of times a column in array can be selected?
Brilliant -- does the job nicely! From that, I also added a validation text :
{if(countif("5",self)<4,'(A maximum of 3 responses may be selected as High Priority)','You can only select a maximum of 3 High Priority Responses')}
So the respondent knows what's up
{if(countif("5",self)<4,'(A maximum of 3 responses may be selected as High Priority)','You can only select a maximum of 3 High Priority Responses')}
So the respondent knows what's up
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12789
- Thank you received: 3940
1 year 10 months ago - 1 year 10 months ago #228061
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to restrict number of times a column in array can be selected?
I didn't mention the validation tip, as you are an experienced user who knows this.
So I only provided the equation.
Regards
Joffm
So I only provided the equation.
Regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 10 months ago by Joffm.
Please Log in to join the conversation.