Welcome, Guest
Username: Password: Remember me

TOPIC: Working with number logic checks

Working with number logic checks 2 years 9 months ago #86303

Hi,

I’m trying to write a skip condition that tests if one of two criteria are being met then they are not asked a particular question.

The first criteria is that a question has a value of no. The second criteria is that a question has a value of yes, but also that a number being pre-entered in a previous question is not one of the following numbers - 6230, 6231, 6280, 6284, 6285, 6286, 6288, 6290.

I have entered the relevance equation below:
((q1== "N") OR ((Q1c != "6230, 6231, 6280, 6284, 6285, 6286, 6288, 6290 ") and (O1a == "Y")))

This currently evaluates the first condition correctly but doesn’t do so for the second one.

Is there something obvious I am missing here, or is there another (better) way to try and evaluate this condition?

Any help would be much appreciated.
Mark Stuart.
The administrator has disabled public write access.

Working with number logic checks 2 years 9 months ago #86379

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 4963
  • Thank you received: 1021
  • Karma: 424
Try:
((q1== "N") OR ((Q1c != "6230") and (Q1c != "6231") and (Q1c != "6280") and (Q1c != "6284") and (Q1c != "6285") and (Q1c != "6286") and (Q1c != "6288") and (Q1c != "6290") and (O1a == "Y")))

Also, is the "O1a" question code correct?
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.
Last Edit: 2 years 9 months ago by tpartner.
The administrator has disabled public write access.

Working with number logic checks 2 years 9 months ago #86437

Thanks Tony!

Questions code is "q1a" - is that what you meant?

Cheers,
Mark.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.178 seconds