Welcome, Guest
Username: Password: Remember me

TOPIC: Conditionals: change and to or

Conditionals: change and to or 1 year 8 months ago #91193

  • sD960
  • sD960's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 45
  • Thank you received: 1
  • Karma: 0
Hello, my name is Fee. I'm quite new to LimeSurvey, and not very sophisticated programming-wise. I am using responses to an Array to determine whether the next question will be visible. A fake example: The Array question is "What do you think of your neighbors", and the array has 2 items on the Y-axis (him, her) and 4 on the X-axis (nice, smart, mean, stupid). I want the next question ("Will you invite them for dinner") to show up only if the survey-taker clicks on him-nice, OR him-smart, OR her-nice, Or her-smart. However, in setting the conditions, LimeSurvey seems to only allow me to set him-nice OR him-smart, AND her-nice OR her-smart. That is, there has to be both a him- AND a her-response (to either nice or smart), instead of what I want, which is any ONE of the 4 him-her-nice-smart responses. I guess I could work around this by having two separate but identical "Will you invite them for dinner" questions--that is, one conditional on the him-responses and one on the her-responses, but that seems really inelegant. Help?!
The administrator has disabled public write access.

Re: Conditionals: change and to or 1 year 8 months ago #91211

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4191
  • Thank you received: 787
  • Karma: 359
If using the conditions designer, you can use scenarios - docs.limesurvey.org/Setting+conditions&s..._the_use_of_scenario

If using Expression Manager and relevance, you can use the OR operator - docs.limesurvey.org/Expression+Manager&s...or+LimeSurvey#Syntax
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Conditionals: change and to or 1 year 8 months ago #91235

  • sD960
  • sD960's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 45
  • Thank you received: 1
  • Karma: 0
Thanks, using scenario did the trick. This is great, especially as my inelegant fix wouldn't have worked anyway, as it would have made the follow-up question "Will you invite them for dinner" appear twice if the survey-taker had selected either him-nice or him-smart AND either her-nice and her-smart.

For the benefit of other users at or below my advanced-beginner level with an analogous OR-vs-AND issue, and since it can be daunting wading through all the information to learn how to solve one's particular problem, I'll explain what I did:

When setting the conditions, I clicked on the Scenario button which showed a default label of 1, and chose him-nice and him-smart, which set up the conditions him-nice OR him-smart, and added those conditions. I then clicked on the Scenario button again which automatically showed a label of 2, chose her-nice and her-smart, which set up the conditions her-nice OR her-smart, and added those conditions. LimeSurvey automatically sets an OR between scenarios 1 and 2, so I end up with ([him-nice OR him-smart] OR [her-nice OR her-smart]). This may seem like a complicated way to get to (him-nice OR him-smart OR her-nice OR her-smart)--logically I don't need the sub-parentheses--but it works!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.089 seconds
Donation Image