Welcome to the LimeSurvey Community Forum

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

Conition "OR" - Can I replace it by "AND"?

  • KMB_Janine
  • KMB_Janine's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #170288 by KMB_Janine
Conition "OR" - Can I replace it by "AND"? was created by KMB_Janine
Hello everybody,

I have a single choice question. But I only want it to show up, if certain answers were chosen in a previous question, namely every answer except of two. I have set the two conditions that the question should only pop up if the previous answer was NOT 1 and NOT 2. Unfortunately, LimeSurvey makes "not 1 OR not 2" out of it. Is there any way to change it? I have tried to set up two different conditions, too, but it does not work out, the question keeps popping up no matter what the answer was beforehand. Or is there an error in my way of thinking?

Thanks in advance!
Janine
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170289 by tpartner
Replied by tpartner on topic Conition "OR" - Can I replace it by "AND"?
You can use a relevance equation instead of the conditions designer.

Judging by the screenshots, I think it would be:

Code:
Schluessel == 'Y' AND Wahrscheinlich != 'A1' AND Wahrscheinlich != 'A5'

Which effectively says show the question if:

Schluessel equals 'Y'
AND
Wahrscheinlich does not equal 'A1'
AND
Wahrscheinlich does not equal 'A5'

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • KMB_Janine
  • KMB_Janine's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #170651 by KMB_Janine
Replied by KMB_Janine on topic Conition "OR" - Can I replace it by "AND"?
Thanks for your help! That makes sense. However, I tried to use the relevance equation, but the system tells me that two variables are undefined, although I used the exact code of the relevant question. Do you know what the problem there is? I tried renaming several times, but it is always the same problem.
The topic has been locked.
  • KMB_Janine
  • KMB_Janine's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 9 months ago #170652 by KMB_Janine
Replied by KMB_Janine on topic Conition "OR" - Can I replace it by "AND"?
Actually, now I got the equation itself accepted and working, but still - if going through the survey, the question keeps showing up, inspite of the answers in the question "Wahrscheinlichkeit"...

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 9 months ago #170654 by DenisChenu
Replied by DenisChenu on topic Conition "OR" - Can I replace it by "AND"?
Looking at your equation : you test string, not value and "something == Y" is always true …

Seems you have subquestion for Wahrscheinlich1 ? Then maybe
Schluessel == 'Y' AND Wahrscheinlich1_SW0101 != 'A1' AND Wahrscheinlich1_SW0101 != 'A5'

But remind : we are not on your system : you must search and check manual

An,d you can (too) use GUI to use == in your condition ( =="A2" or =="A3" or =="A4" …)

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 topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose