- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Additive filter based on a multiple choice question
- izumi
- Topic Author
- Offline
- New Member
Less
More
7 years 3 months ago #145934
by izumi
Additive filter based on a multiple choice question was created by izumi
Hi everyone,
I would like to create a filter for Question2: The question should only be asked if more than one option was selected for Question1.
Question1 is a matrix variable where respondents can choose between "does apply" and "does not apply" for multiple sub-questions.
Question2 should only be directed at those respondents who selected "does apply" at least twice for any of the sub-questions.
Thank you for your help!
Best wishes,
Izumi
I would like to create a filter for Question2: The question should only be asked if more than one option was selected for Question1.
Question1 is a matrix variable where respondents can choose between "does apply" and "does not apply" for multiple sub-questions.
Question2 should only be directed at those respondents who selected "does apply" at least twice for any of the sub-questions.
Thank you for your help!
Best wishes,
Izumi
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
7 years 3 months ago #145938
by DenisChenu
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.
Replied by DenisChenu on topic Additive filter based on a multiple choice question
countif("apply",that.Question1.NAOK)
where apply is the code for "does apply"
See manual.limesurvey.org/Expression_Manager....27that.27_variables and manual.limesurvey.org/Expression_Manager#Implemented_Functions
where apply is the code for "does apply"
See manual.limesurvey.org/Expression_Manager....27that.27_variables and manual.limesurvey.org/Expression_Manager#Implemented_Functions
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: izumi
The topic has been locked.
- izumi
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 3 months ago #145948
by izumi
Replied by izumi on topic Additive filter based on a multiple choice question
Thank you so much! It worked
The topic has been locked.
- izumi
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
7 years 3 months ago #145951
by izumi
Replied by izumi on topic Additive filter based on a multiple choice question
Sorry, but I had to change the question type to "Multiple choice" of Question1 and now it does not work any mroe. I am unable to figure out how to adapt the equation.
The overview of previous questions to Question2 has the following structure with pdwrkXXX being Question1:
pdwrkXXX:[Group of checkboxes] .....
pdwrkXXX:SQ008:[Other][Single Checkbox]...
pdwrkXXX:SQ007:[....][Single Checkbox]...
etc.
The predefined answers for pdwrkXXX are the codes for the sub-questions such as SQ008 or SQ007.
The predefined answers for the sub-questions such as pdwrkXXX:SQ008 are Y(checked) and (not checked).
The overview of previous questions to Question2 has the following structure with pdwrkXXX being Question1:
pdwrkXXX:[Group of checkboxes] .....
pdwrkXXX:SQ008:[Other][Single Checkbox]...
pdwrkXXX:SQ007:[....][Single Checkbox]...
etc.
The predefined answers for pdwrkXXX are the codes for the sub-questions such as SQ008 or SQ007.
The predefined answers for the sub-questions such as pdwrkXXX:SQ008 are Y(checked) and (not checked).
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
7 years 3 months ago #145955
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Additive filter based on a multiple choice question
If you only want to show Q2 if Q1 has at least 2 checked boxes, use something like this:
Code:
count(that.Q1) > 1
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.