- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to make the relevance equation work when using two questions?
- pieter1970
- Topic Author
- Offline
- New Member
Less
More
7 years 7 months ago #139805
by pieter1970
How to make the relevance equation work when using two questions? was created by pieter1970
I know, this should be possible, but i do not know how. I have three questions, like the following
Q1: are you married?
1-Yes
2- No
Q2: do you live together? --> only asked when Q2=No(2)
1- Yes
2- No
Q3: What's the gender of your inmate? --> Only asked when Q1=Yes (1) or Q2=no (2)
1- Male
2-Female
I tried several equations in the relevance for Q3, but unfortunately did not succeed in getting this right.
For example: Q1==1 or Q2==2 was not succesful
Any help will highly be appreciated!
Pieter
Q1: are you married?
1-Yes
2- No
Q2: do you live together? --> only asked when Q2=No(2)
1- Yes
2- No
Q3: What's the gender of your inmate? --> Only asked when Q1=Yes (1) or Q2=no (2)
1- Male
2-Female
I tried several equations in the relevance for Q3, but unfortunately did not succeed in getting this right.
For example: Q1==1 or Q2==2 was not succesful
Any help will highly be appreciated!
Pieter
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12713
- Thank you received: 3926
7 years 7 months ago #139807
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to make the relevance equation work when using two questions?
Hi, Pieter,
(Q1.NAOK == "1") or (Q2.NAOK == "1")
Regards
Joffm
(Q1.NAOK == "1") or (Q2.NAOK == "1")
Regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12713
- Thank you received: 3926
7 years 7 months ago #139811
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to make the relevance equation work when using two questions?
Hi, Pieter,
of course it is (Q2.NAOK=='2').
Yesterday it was too late to write more.
Well, the default behaviour of LS is:
If there are two different questions involved the condition manager always is AND like (Q1=1) AND (Q2=1).
If there is only one question it' s OR like (Q1=1) OR (Q1=5).
In your case you have to use scenarios in "Set conditions".
manual.limesurvey.org/Setting_conditions...nition_of_a_scenario .
Or more general:
manual.limesurvey.org/Setting_conditions...ndition_combinations
Best regards
Joffm
of course it is (Q2.NAOK=='2').
Yesterday it was too late to write more.
Well, the default behaviour of LS is:
If there are two different questions involved the condition manager always is AND like (Q1=1) AND (Q2=1).
If there is only one question it' s OR like (Q1=1) OR (Q1=5).
In your case you have to use scenarios in "Set conditions".
manual.limesurvey.org/Setting_conditions...nition_of_a_scenario .
Or more general:
manual.limesurvey.org/Setting_conditions...ndition_combinations
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
7 years 7 months ago - 7 years 7 months ago #139815
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to make the relevance equation work when using two questions?
I think, because Q2 is conditional, the key (as Joffm points out) is to use ".NAOK" in the relevance statement -
manual.limesurvey.org/Expression_Manager#Usage_of_NAOK
Code:
Q1.NAOK == 1 OR Q2.NAOK == 2
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 7 months ago by tpartner.
The topic has been locked.