Welcome, Guest
Username: Password: Remember me

TOPIC: Creating a Condition that requires a mixture of ANDs and ORs

Creating a Condition that requires a mixture of ANDs and ORs 2 years 10 months ago #71963

  • guelphpeter
  • guelphpeter's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 36
  • Thank you received: 1
  • Karma: 0
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,

Peter McCaskelll
University of Guelph
Guelph, Ontario, Canada
The administrator has disabled public write access.

Re: Creating a Condition that requires a mixture of ANDs and ORs 2 years 10 months ago #71966

  • guelphpeter
  • guelphpeter's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 36
  • Thank you received: 1
  • Karma: 0
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>
The administrator has disabled public write access.

Re: Creating a Condition that requires a mixture of ANDs and ORs 2 years 10 months ago #71967

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
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: 2 years 10 months ago by TMSWhite.
The administrator has disabled public write access.

Re: Creating a Condition that requires a mixture of ANDs and ORs 2 years 10 months ago #71968

  • guelphpeter
  • guelphpeter's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 36
  • Thank you received: 1
  • Karma: 0
Thanks as always for your help Tom - really appreciated !

Looking forward to having a look at version 1.92 !

Peter
The administrator has disabled public write access.

Re: Creating a Condition that requires a mixture of ANDs and ORs 2 years 10 months ago #72003

  • Mazi
  • Mazi's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 5426
  • Thank you received: 307
  • Karma: 252
Thanks for sharing your findings!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.161 seconds
Donation Image