Welcome to the LimeSurvey Community Forum

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

Conditioning Query

  • SamSteff
  • SamSteff's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169418 by SamSteff
Conditioning Query was created by SamSteff
Hello,

May be a simple answer but i'm a bit of a Lime Survey novice!

I have an Array with 5 answers and 4 possible options for those 5.

I need to be able to make the user go to a new question when they pick only one of the options of the 5 answers (or if they pick more than one then it goes to that one question also)

I cant work out what Comparison operator to pick as if i put Equals to for the one option for all 5 Answers it will only open up that question when the user picks that option for all 5 answers when it should appear when only picked once (or more if needed)

I hope that makes sense, i just need to work out what Comparison operator to put against the one option for all 5 answers which will then allow the question to pop up when this is picked.

Any help would be appreciated!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169420 by Joffm
Replied by Joffm on topic Conditioning Query
Hello,
sorry, you confused me a bit.
I understand, you have an array (Q1) with 5 subquestions (SQ001..SQ005) and 4 answer options (1 - 4).

go to a new question when they pick only one of the options of the 5 answers (or if they pick more than one then it goes to that one question also)

So, if the respondent selects e.g. "option 2" in all 5 subquestions he will see question Q2?

Then the relevance equation of Q2 would be:
(Q1_SQ001==1 AND Q1_SQ002==1 AND Q1_SQ003==1 AND Q1_SQ004==1 AND Q1_SQ005==1)

If I misunderstood your problem, please clarify and - always best - send a sample (*.lss)

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • SamSteff
  • SamSteff's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169421 by SamSteff
Replied by SamSteff on topic Conditioning Query
Sorry, i'll try and explain a little better, so at the moment you only see Q2 when answering Q1 and you select the same Answer option for all SQ's, i want it to bring up Q2 when this same answer is picked in 1 (or more) of the SQ's. I just need to know what the Comparison operator would be for each of the Answers so that it brings up Q2 if its picked as at the moment as its "Equals" it will only bring up Q2 when all of the same answer is picked for each SQ.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago #169422 by Joffm
Replied by Joffm on topic Conditioning Query
Sorry, this is just a little bit better.
What is the condition for Q2?
What is "this same answer in 1 or more..."
Does it mean if the person selects "2" in one or more subquestions?
(Q1_SQ001==2 OR Q1_SQ002==2 OR Q1_SQ003==2 OR Q1_SQ004==2 OR Q1_SQ005=2)

Without seeing your example I can recommend that you read about functions like "countifop".
manual.limesurvey.org/Expression_Manager#Implemented_Functions
With this you can count how many times the respondent answered e.g. "3" in the entire array.

Regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • SamSteff
  • SamSteff's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169424 by SamSteff
Replied by SamSteff on topic Conditioning Query
I've mocked up a paint view of the question, Q2 hasnt got any conditioning against it yet, if you cant get it from the picture ill dive into the link you provided.
The topic has been locked.
  • SamSteff
  • SamSteff's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 10 months ago #169425 by SamSteff
Replied by SamSteff on topic Conditioning Query
I've sorted it! As i said i was a novice and hadn't looked into the "Scenario" option. which makes complete sense now that i know its there! Thanks for the support though its massively appreciated.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 10 months ago - 5 years 10 months ago #169426 by Joffm
Replied by Joffm on topic Conditioning Query
Okay,
then it is exactly this one:
(Q1_SQ001==2 OR Q1_SQ002==2 OR Q1_SQ003==2 OR Q1_SQ004==2 OR Q1_SQ005=2)
with "2" as the answer option code.
If you let the codes as default - "A1", "A2", it will be
(Q1_SQ001=="A2" OR Q1_SQ002=="A2" OR Q1_SQ003=="A2" OR Q1_SQ004=="A2" OR Q1_SQ005="A2")

Other answer options analogue.

with the function "countifop" you could have said

countifop("==","A2",that.Q1)>0
or
countifop("==","A3",that.Q1)>0

or
countif("A4",that.Q1)>0

You see the difference between "countifop" and "countif"?
"countifop" allows to say "countifop(">",50,that.QX)" - e.g. count all who are older then 50.


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 5 years 10 months ago by Joffm.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose