Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Display questions only if 3 or more answers are selected in the previous MCquest

  • dianavieiraf
  • dianavieiraf's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 1 day ago #195933 by dianavieiraf
Hello,

I want to display a question only if the participant selects 3 or more answers in the previous multiple choice question. I've tried to insert count(PTSDJ4.NAOK) > 3 in question relevance but it keeps saying that the variable is not defined, even though it is (I think). I have also read a lot of manuals but I could not find a solution in any of them.
I'm not very familiar with LimeSurvey, so I would really appreciate if you could explain this to me!

Thanks!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 day ago - 4 years 1 day ago #195937 by Joffm
PTSDJ4 is the code of the question. But you really want to count the subquestions.
So the "count" of the question is obviously useless and not supported by this function.

You have to use:
count(PTSDJ4_SQ001.NAOK, PTSDJ4_SQ002.NAOK,...)>3

To shorten this you may use the "that" variable.
manual.limesurvey.org/ExpressionScript_-....22that.22_variables

You will see that
count(that.PTSDJ4.NAOK) > 3
expands to
count(PTSDJ4_SQ001.NAOK, PTSDJ4_SQ002.NAOK, PTSDJ4_SQ003.NAOK, PTSDJ4_SQ004.NAOK, PTSDJ4_SQ005.NAOK, PTSDJ4_SQ006.NAOK, PTSDJ4_SQ007.NAOK) > 3

You see that now the subquestions are counted; of course only "selected" subquestions are counted.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 1 day ago by Joffm.
The topic has been locked.
  • dianavieiraf
  • dianavieiraf's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 1 day ago #195945 by dianavieiraf
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose