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

More
7 years 3 months ago #145934 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
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #145938 by DenisChenu
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

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.
More
7 years 3 months ago #145948 by izumi
Thank you so much! It worked :)
The topic has been locked.
More
7 years 3 months ago #145951 by izumi
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 topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #145955 by tpartner
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.

Lime-years ahead

Online-surveys for every purse and purpose