Welcome to the LimeSurvey Community Forum

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

relevance equation unequal 0

  • KompetenzZ
  • KompetenzZ's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 1 month ago #149092 by KompetenzZ
relevance equation unequal 0 was created by KompetenzZ
Hello,
I set the following relevance equation for the question a7 after question a6 "How much money are you spending on one ton...":
((a6_SQ001 != "0" or a6_SQ002 != "0"))

But the the next question a8 should be hidde only when in q7 is filled in 0, (filled in zero one time if one bedding is chosen or filled in 0 two times if two beddings are chosen). But the question a8 should not be hidden if two bedding types are chosen in q6 and only one is filled in with 0 in q7.
I am looking for the right relevance equation to do this for all alternatives, but this one doesn't work:
((a6_SQ001 != "0" or a6_SQ002 != "0" or a6_SQ003 != "0" or a6_SQ004 != "0" or a6_SQ005 != "0" or a6_SQ006 != "0" or a6_SQ007 != "0" or a6_SQ008 != "0" or a6_SQ009 != "0" or a6_other != "0"))

Here is a test link of the survey (q6-q8 are on the second page):

survey.toscani.at/index.php/771127?lang=en

Here is a picture of these three questions:


Cheers kompetenzz
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #149094 by holch
Replied by holch on topic relevance equation unequal 0
Problem should be the "" around the zeros. They turn the zero from a number to a string. But you have a question that only allows numbers. So this can't work.

The next problem I see is that you use only "or", which means if one of the questions are zero, it will not be shown.

At the end of the day what you want is that the sum of the answers (either one or two) is NOT zero, to show the question. I think there is a simple way to sum all the number inputs from your second question and then check if it is zero, then hide the question.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 1 month ago #149110 by tpartner
Replied by tpartner on topic relevance equation unequal 0
I'm a little confused about your question codes (your description doesn't seem to match the image) but if the question code for the multiple-numeric is "a6", you should be able to use something like this:

Code:
sum(that.a6.NAOK) > 0

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • KompetenzZ
  • KompetenzZ's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 1 month ago #149195 by KompetenzZ
Replied by KompetenzZ on topic relevance equation unequal 0
Thank you, it works :-)

Cheers kompetenzz
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose