Sometimes it might be necessary to display an item according to the number of answers previously selected in a multiple choice question.
Instructions #
Write the “CountCode” function in the Display Condition GUI box of the page:
if(CountCode (<em>Question Code) == Number of options</em>)
If you want to set it in the IdCode, write the code as follows:
/F "if(CountCode (<em>Question Code) == Number of options</em>)"
You can set the condition for as many options as you want.
Note
- IdSurvey 6 uses a different syntax from version 7, since you do not need to enclose the Question Code within round brackets. Please refer to the breaking changes article for further informations.
Example #
In question “Q1” I want to ask which product(s) from a specific brand the interviewer would purchase first. I want page “P2” to appear only if only one option in question “Q1” was selected.
In the gearwheel button of page “P2” I will set following filter: if(CountCode (Q1) ==1)
The entire IdCode is as follows:
