- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Condition "not equal to" doesn't seem to work
- macdoki
- Topic Author
- Offline
- New Member
Less
More
9 years 3 months ago #115214
by macdoki
Condition "not equal to" doesn't seem to work was created by macdoki
I am not sure if this is the right place to post this question, I am completely new to this whole process. I am entering a survey in limesurvey 2.0 and I want a question to "ask IF" a response to a previous question is NOT EQUAL TO or a token is NOT EQUAL TO and the condition doesn't seem to work. For example:
What is your highest level of education?
1) No Formal Education
2) Elementary School
3) High School
4) Any post secondary
I need the next variable to appear if the response to the education question is NO EQUAL TO 4) Any post secondary, but it doesn't seem to work. I have to add 3 different scenarios in the condition list that says Show this question if the response is 1) No Formal Education OR 2) Elementary School OR 3) High School
What is your highest level of education?
1) No Formal Education
2) Elementary School
3) High School
4) Any post secondary
I need the next variable to appear if the response to the education question is NO EQUAL TO 4) Any post secondary, but it doesn't seem to work. I have to add 3 different scenarios in the condition list that says Show this question if the response is 1) No Formal Education OR 2) Elementary School OR 3) High School
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
9 years 3 months ago #115217
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Condition "not equal to" doesn't seem to work
Can you show a screenshot of the condition that doesn't work and what it should do?
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.
- macdoki
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
9 years 3 months ago - 9 years 3 months ago #115219
by macdoki
Replied by macdoki on topic Condition "not equal to" doesn't seem to work
attached are two screen shots. The first is using the "not Equal to" this does not work, the question always shows if I use this condition, the second is the work around where I have to use three different scenarios to make sure the question shows properly.
I should note that for a fairly simple question like this using the work around is not a big problem, but I have far more complicated scenarios that I have to use this for where I have 1 of 11 different tokens that the variable doesn't apply so I have to make 10 different scenarios for the other 10 toeks for which it does.
I should note that for a fairly simple question like this using the work around is not a big problem, but I have far more complicated scenarios that I have to use this for where I have 1 of 11 different tokens that the variable doesn't apply so I have to make 10 different scenarios for the other 10 toeks for which it does.
Attachments:
Last edit: 9 years 3 months ago by macdoki. Reason: additional information
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
9 years 3 months ago #115224
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 Condition "not equal to" doesn't seem to work
Not sure why that's happening but you may find it easier to enter the relevance equation directly instead of using the conditions designer.
So, for your first example:
And for the more complex example, assuming "site" is ATTRIBUTE_1 (line breaks added for clarity):
So, for your first example:
Code:
TRA_PR_INC5 != 'POSTSEC'
And for the more complex example, assuming "site" is ATTRIBUTE_1 (line breaks added for clarity):
Code:
(TOKEN:ATTRIBUTE_1 == "British Columbia" OR TOKEN:ATTRIBUTE_1 == "Manitoba" OR TOKEN:ATTRIBUTE_1 == "Victoria" OR TOKEN:ATTRIBUTE_1 == "Calgary" OR TOKEN:ATTRIBUTE_1 == "Dalhousie" OR TOKEN:ATTRIBUTE_1 == "Sherbrooke" OR TOKEN:ATTRIBUTE_1 == "Ottawa" OR TOKEN:ATTRIBUTE_1 == "Simon Fraser" OR TOKEN:ATTRIBUTE_1 == "McGill" OR TOKEN:ATTRIBUTE_1 == "Hamilton") AND TRA_PR_INC5 == 'POSTSEC'
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- macdoki
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
9 years 1 week ago #118411
by macdoki
Replied by macdoki on topic Condition "not equal to" doesn't seem to work
Any idea if this condition works in the most updated version? I am getting ready to input a very large survey and I don't think using the relevance equation will be the easiest way for me. I am not a programmer, I am a research coordinator, this is a bit foreign to me.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
9 years 1 week ago #118412
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Condition "not equal to" doesn't seem to work
I would really recommend to look into the Expression manager, even as a research coordinator. Once you get it (and it is actually not that difficult), you'll save yourself a lot of time. I found it a lot more convenient and a lot quicker to write an equation than to go through all the conditions manager.
The examples given by Tony look complicated at first, but actually they are quite simple, once you tried to understand what is happening.
The first one is only complicated, because you have very complicated question code.
It says, show the question only, if the question with the code TRA_PR_INC5 is NOT equal (! to the response 'POSTSEC'. If you want to show the question if the response IS 'POSTSEC' and no other, then you would use '==' instead of '!=='. With that you are already very good and this procedure is quicker than go to the condition manager, because you can do it right where you edit the question.
Now the second example looks complicated, but it isn't, is is just involving a lot of answer options.
The first part between parentesis checks if the Token attribute called attribute1 contains any of the responses 'British Columbia', 'Manitoba', etc.
And it checks if the question with the code TRA_PR_INC5 is equal to POSTSEC. So this question will only show if the token attribute1 is any of the locations (connected via OR) AND at the same time the other question is answered with POSTSEC.
I theory this should work in the newest version, but since I am using the Expression Manager and Equations, I have not looked at the condition tool anymore...
The examples given by Tony look complicated at first, but actually they are quite simple, once you tried to understand what is happening.
The first one is only complicated, because you have very complicated question code.
It says, show the question only, if the question with the code TRA_PR_INC5 is NOT equal (! to the response 'POSTSEC'. If you want to show the question if the response IS 'POSTSEC' and no other, then you would use '==' instead of '!=='. With that you are already very good and this procedure is quicker than go to the condition manager, because you can do it right where you edit the question.
Now the second example looks complicated, but it isn't, is is just involving a lot of answer options.
The first part between parentesis checks if the Token attribute called attribute1 contains any of the responses 'British Columbia', 'Manitoba', etc.
And it checks if the question with the code TRA_PR_INC5 is equal to POSTSEC. So this question will only show if the token attribute1 is any of the locations (connected via OR) AND at the same time the other question is answered with POSTSEC.
I theory this should work in the newest version, but since I am using the Expression Manager and Equations, I have not looked at the condition tool anymore...
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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10634
- Thank you received: 3698
9 years 1 week ago #118447
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 Condition "not equal to" doesn't seem to work
Expression Manager operators -
manual.limesurvey.org/Survey_settings#No..._.26_data_management
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.