Check out the LimeSurvey source code on GitHub!

Working with number logic checks

More
4 years 4 months ago #86303 by StuartMark0
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.

Please Log in to join the conversation.

More
4 years 4 months ago - 4 years 4 months ago #86379 by tpartner
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.
Last Edit: 4 years 4 months ago by tpartner.

Please Log in to join the conversation.

More
4 years 4 months ago #86437 by StuartMark0
Thanks Tony!

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

Cheers,
Mark.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form