Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Conditional setting based on set of questions

  • jimdavies
  • jimdavies's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #169603 by jimdavies
I have a question I need to ask if someone answered 'Disagree' to either of the previous two questions but when I add the condition for the second question it goes on an AND condition instead of an OR.
Screen shot of the conditions attached
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169607 by holch
Which version of LS?
Can you attach a little test survey, with only the relevant questions included (.lss file)?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • jimdavies
  • jimdavies's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #169609 by jimdavies
Replied by jimdavies on topic Conditional setting based on set of questions
LSS attached.
Sorry, I'm not sure where to see the version of LS I'm using.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169631 by tpartner
Replied by tpartner on topic Conditional setting based on set of questions
You can use scenarios in the conditions designer to insert an OR.

Having said that, it is far easier to use a relevance equation:

Code:
Q1 == '1' OR Q1 == '2' OR Q1 == '3' OR Q2 == '1' OR Q2 == '2' OR Q2 == '3'

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169640 by holch

Sorry, I'm not sure where to see the version of LS I'm using.

For future reference, you can find the Limesurvey in the bottom right corner of the admin pages.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • jimdavies
  • jimdavies's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #169656 by jimdavies
Replied by jimdavies on topic Conditional setting based on set of questions
Thanks holch. I'm on version Version 2.50+ Build 160810.
The topic has been locked.
  • jimdavies
  • jimdavies's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #169657 by jimdavies
Replied by jimdavies on topic Conditional setting based on set of questions
Could you provide more detail? I don't see where I can change it from an AND to an OR condition.
The topic has been locked.
  • jimdavies
  • jimdavies's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago - 5 years 10 months ago #169658 by jimdavies
Replied by jimdavies on topic Conditional setting based on set of questions
I added the relevance question but now question 3 never displays. Attachment shows what I did
Last edit: 5 years 10 months ago by jimdavies. Reason: Updated attachment
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago - 5 years 10 months ago #169684 by tpartner
Replied by tpartner on topic Conditional setting based on set of questions
That is not supposed to be in the conditions designer. Delete all conditions for the question there and insert the equation in the Relevance field when editing the question.

Maybe the manual would help.

- manual.limesurvey.org/Questions_-_introd...n#Field_descriptions

- manual.limesurvey.org/Expression_Manager...tion-Level_Relevance

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 10 months ago by tpartner.
The topic has been locked.
  • jimdavies
  • jimdavies's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #169739 by jimdavies
Replied by jimdavies on topic Conditional setting based on set of questions
Thanks, I was able to get it to work. I appreciate your help and patience!
The topic has been locked.
  • jimdavies
  • jimdavies's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago - 5 years 10 months ago #169817 by jimdavies
Replied by jimdavies on topic Conditional setting based on set of questions
Is there a way to set the condition on questions set up in an array? I followed the same logic and it's not working. Screen shots show the question and answer codes and the error I receive
Last edit: 5 years 10 months ago by jimdavies.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169818 by holch
You can, but you are referencing the subquestions wrong.

You need to tell Limesurvey which question you are referring to and which subquestion you are referring to. AS So what is the question code of this array question? Because Q12-Q16 seem to be the subquestion codes.

So to reference the subquestions you need to go like this QUESTIONCODE_SUBQUESTIONCODE. If you would use numbers for the answer codes you could shorten your equation quite a bit by use >, < and = to define everything in one.

Lets assume you want to reference the subquestion Q12, lets assume the question code of the whole question is QC and the answer options are 1-5 and you only want 1-3 go further.

Then you could write something like this:
Code:
QC_Q12 < 4
If you put this into the long free text question as relevance equation, the question would open if the respondent answere 1, 2 or 3 in subquestion Q12 of question QC.

If you really want to stick to your current answer codes it will be more or less the same, you just will have to have a longer relevance equation.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose