Welcome to the LimeSurvey Community Forum

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

Relevance Equation == VS !=

  • LSSSurvey1
  • LSSSurvey1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 2 days ago #263026 by LSSSurvey1
Relevance Equation == VS != was created by LSSSurvey1
When i put in the Relevance Equation the equal signs   G1Q00001=='A1' or G1Q00001=='A2'  then the equation works perfectly as expected. 

but when i use in the Relevance Equation not equal to signs  G1Q00001!='A1' or G1Q00001!='A2'   then the equation doesn't work 

if i use one not equal to equation without OR  G1Q00001!='A1' by itself then the Relevance Equation works as expected. 

what's wrong with using the OR function with the not equal to  G1Q00001!='A1' or G1Q00001!='A2'  in a relevance Equation? 

thanks for your help.s



 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 2 days ago - 2 weeks 2 days ago #263042 by Joffm
Replied by Joffm on topic Relevance Equation == VS !=
Hi,
what do you want to achieve with this equation?
G1Q00001!='A1' or G1Q00001!='A2'

And what means "doesn't work"?

Let's have a look at the results (something like a truth table)
"A1" selected: TRUE  (because "A2" is not selected)
"A2" selected: TRUE  (because "A1" is not selected)
"A3" selected: TRUE  (because neither "A1" nor "A2" are selected)
As we learned at school (Boolean algebra):
An "OR" operation is TRUE if at least one of the operators is TRUE

So in a single question this equation is always true. 

If you want to achieve that a next question is only displayed if neither "A1" nor "A2" are selected, the equation has to be
G1Q00001!='A1' AND G1Q00001!='A2'
An "AND" operation is TRUE if both of the operators are TRUE

And if you used numerical codes this would have been much easier:
G1Q00001>2

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 weeks 2 days ago by Joffm.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • LSSSurvey1
  • LSSSurvey1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 1 day ago #263073 by LSSSurvey1
Replied by LSSSurvey1 on topic Relevance Equation == VS !=
in the first group, first question G1Q00001 has a drop down menu for people to select the type of survey they want to take (A1, A2, A3, etc..), in the second group it has an Array with some subquestions. based on the survey they want to take some subquestions are not relevant to that Survey, so when i put G1Q00001!='A1' in the Relevance Equation of the subquestion then this hids that subquestion when the A1 survey is selected.
this above works on my locally hosted version of LimeSurvey to supress the unneeded subquestions, but i just signed up for a cloud account but the same equations don't supress the subquestins, they still show up even after i put the equation
like this below one for example works to hid the subquestions in my locally hosted version
((G1Q00001.NAOK != "A10" or G1Q00001.NAOK != "A21" or G1Q00001.NAOK != "A23" or G1Q00001.NAOK != "A25" or G1Q00001.NAOK != "A31")) but it doesn't on my cloud based

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 1 day ago #263081 by Joffm
Replied by Joffm on topic Relevance Equation == VS !=
Please, send the lss export.
I am afraid that there still is something different.
As you did not mention in your first post that you talk about "subquestion relevance"

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • LSSSurvey1
  • LSSSurvey1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 1 day ago #263085 by LSSSurvey1
Replied by LSSSurvey1 on topic Relevance Equation == VS !=
please see group 3, question 1, subquestion 6, that's where you see the G1Q00001!='A10' or G1Q00001!='A16'
if you  put only G1Q00001!='A10'  then run the survey and select survey 10 from group 1 question 1, then you will see that the subquestion 6 in question 1 group 3 doesn't show up. 
but if you put G1Q00001!='A10' or G1Q00001!='A16'  then subquestion 6 will show up in every survey regadless if its 10,16 or anything else. 

 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 1 day ago #263088 by Joffm
Replied by Joffm on topic Relevance Equation == VS !=

but if you put G1Q00001!='A10' or G1Q00001!='A16'

Of course, I already wrote.
This equation is always TRUE.
If you select "A10" the second part (G1Q00001!='A16') is TRUE.
If you select "A16" the first part (G1Q00001!='A10') is TRUE.
If you select none of them both parts are TRUE.

This disjunction would only be FALSE if both parts are FALSE.
Meaning:
G1Q00001!='A16' is FALSE  and G1Q00001!='A10' is FALSE.
But this means: You selected A10 and A16, which is not püossible in a single question.

[url] en.wikipedia.org/wiki/Boolean_algebra [/url]
Joffm




 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • LSSSurvey1
  • LSSSurvey1's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 weeks 1 day ago #263102 by LSSSurvey1
Replied by LSSSurvey1 on topic Relevance Equation == VS !=
yes, i got it now, thanks!.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose