Welcome to the LimeSurvey Community Forum

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

creating an "and" condition

  • yohay
  • yohay's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 7 months ago #173907 by yohay
creating an "and" condition was created by yohay
Hi,
I have a question which need to be shown based on a value from a previous answer
The logic is :
only show this question if answer is not "A" and answer is not "b"

I understand that I can't create a condition with an "AND" logic if it's based on the same question (only an "OR" condition can be set) so I've created an equation instead with an AND logic instead of an OR.
But now the question is hidden no matter what.

Can anyone have an idea why this is happened?

this is the equation:

((quest.NAOK != "ans1")) AND ((quest.NAOK != "ans2"))




Thanks in advance
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 7 months ago #173914 by DenisChenu
Replied by DenisChenu on topic creating an "and" condition
Seems OK for me …

screenshot of Question Logic file ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 7 months ago #173917 by Joffm
Replied by Joffm on topic creating an "and" condition
Hi,
just to explain:

In the condition manager you have to create a new scenario to do this.

But nowadays - since we have the Expression manager - it's a lot easier.

You created an question of type equation. Why? And it doesn't work?
Unless you do not show us exactly what you did, we cannot help.

But you do not need the equation.
Just enter your condition in the Relevance equation of the question.
So, if Q2 is only displayed if (Q1!=1 AND Q1!=2), enter this in the Relevance equation of Q2.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: yohay
The topic has been locked.
  • yohay
  • yohay's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 5 months ago #176000 by yohay
Replied by yohay on topic creating an "and" condition
Thank you both (quite late).

For some reason it didn't work perfectly with the expression manager but I did a workaround, turning the condition upside down and its working fine
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose