- Posts: 7
- Thank you received: 0
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
- Topic Author
- Offline
- New Member
Less
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
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
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 9 months ago #170289
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
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:
Which effectively says show the question if:
Schluessel equals 'Y'
AND
Wahrscheinlich does not equal 'A1'
AND
Wahrscheinlich does not equal 'A5'
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
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.
Attachments:
The topic has been locked.
- KMB_Janine
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
5 years 9 months ago #170652
by KMB_Janine
Replied by KMB_Janine on topic Conition "OR" - Can I replace it by "AND"?
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
5 years 9 months ago #170654
by DenisChenu
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.
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" …)
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.