- Posts: 385
- Thank you received: 32
- Forum
- English support forums
- Can I do this with LimeSurvey?
- How to restrict number of times a column in array can be selected?
How to restrict number of times a column in array can be selected?
1 month 2 weeks ago - 1 month 2 weeks ago #228057
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 month 2 weeks ago by blocka.
Please Log in to join the conversation.
1 month 2 weeks ago - 1 month 2 weeks 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 month 2 weeks ago by Joffm.
Please Log in to join the conversation.
1 month 2 weeks 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.
1 month 2 weeks ago - 1 month 2 weeks 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 month 2 weeks ago by Joffm.
Please Log in to join the conversation.