# Creating a Condition that requires a mixture of ANDs and ORs

5 years 4 months ago #71963
guelphpeter created the topic: Creating a Condition that requires a mixture of ANDs and ORs
Sorry for what well may be a newbie question but this one has me baffled and I'd be grateful for any help please. I'm sure the answer is to use "scenarios" but I'm stumped on how to do it.

Can anyone show me how to make this condition for a question please ?

Only show this question if:

Quest_1 = "yes" AND Quest_2 = "yes" AND
( Quest_3 = "yes" OR Quest_4 = "yes" OR Quest_5 = "yes" )

Thanks in advance for any help,

University of Guelph

5 years 4 months ago #71966
guelphpeter replied the topic: Creating a Condition that requires a mixture of ANDs and ORs
Hi again everyone. I finally figured my question (above) out so I wanted to withdraw the request.

For those interested, the solution is to make three scenarios:

Scenario 1 is: Quest_1 = "yes" AND Quest_2 = "yes" AND Quest_3 = "yes"

Scearnio 2 is: Quest_1 = "yes" AND Quest_2 = "yes" AND Quest_4 = "yes"

Scearnio 3 is: Quest_1 = "yes" AND Quest_2 = "yes" AND Quest_5 = "yes"

Because the scenarios get "Or'd" together they do what I needed which was:

Quest_1 = "yes" AND Quest_2 = "yes" AND
( Quest_3 = "yes" OR Quest_4 = "yes" OR Quest_5 = "yes" )

I hope the above may be helpful to someone - it's simple once the lightbulb finally came on over my head <grin>

5 years 4 months ago - 5 years 4 months ago #71967 by TMSWhite
TMSWhite replied the topic: Creating a Condition that requires a mixture of ANDs and ORs
guelphpeter-

In LS 1.92 RC2 , you can do the following. For brevity, I'll name your questions Q1-Q5. Set the relevance equation for the question to this:
`Q1=='Y' and Q2=='Y' and (Q3=='Y' or Q4=='Y' or Q5=='Y')`

where Q1-Q5 are the actual names of the questions, not the <a href=' www.docs.limesurvey.org/tiki-index.php?p...tions+for+LimeSurvey '>SGQA</a> codes.

/Tom
Last Edit: 5 years 4 months ago by TMSWhite.

5 years 4 months ago #71968
guelphpeter replied the topic: Creating a Condition that requires a mixture of ANDs and ORs
Thanks as always for your help Tom - really appreciated !

Looking forward to having a look at version 1.92 !

Peter

5 years 4 months ago #72003 by Mazi
Mazi replied the topic: Creating a Condition that requires a mixture of ANDs and ORs

Best regards/Beste Grüße,
Dr. Marcel Minke