Welcome to the LimeSurvey Community Forum

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

Conditions on more than one question

  • FlipPipp
  • FlipPipp's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 5 months ago #242912 by FlipPipp
Conditions on more than one question was created by FlipPipp
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
I have set up a survey and there are conditions for a number of questions. I have managed to select multiple answers for the question which allows the relevant questions to be asked for some of the participants. I am wanting to know if I can set conditions for the same questions but from a different answer? Whwn I try to add those to the question, it will state 'AND' instead of the 'OR' I want it to be. Is this even possible? 

Thank you. 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago - 1 year 5 months ago #242922 by Joffm
Replied by Joffm on topic Conditions on more than one question
Hi,
you can do it, but PLEASE do not use this "condition builder"!
Use ExpressionScript. It's easier, mightier and more flexible,.
Read the manual about the comparison of the two options.
[url] www.limesurvey.org/manual/ExpressionScri...ons_and_Relevance.3F [/url]

With ExpressionScript this is quite easy:
If Q1 is a multiple question and you want to show Q2 only
  • if SQ001 OR SQ004 in Q1 were selected: Q1_SQ001=="Y" OR Q1_SQ004=="Y"
  • if SQ001 AND SQ004 in Q1 were selected: Q1_SQ001=="Y" AND Q1_SQ004=="Y"
This way you can build really complex conditions like
(Q1a==1 OR (Q1a==4 AND Q1b_SQ001==“Y“)) AND (Q1c>29 AND Q1c<60)
Meaning:
(
Q1a was answered with option 1 
OR
Q1a was answered with option 4 AND subquestion SQ001 of Q1b was selected 
)
AND
the value of Q1c was between 30 and 59

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 5 months ago by Joffm.

Please Log in to join the conversation.

  • FlipPipp
  • FlipPipp's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 5 months ago #242978 by FlipPipp
Replied by FlipPipp on topic Conditions on more than one question
Thank you very much for your reply. I did manage to do it by adding in new scenarios to the question that appears to have done what I require.

I do not think that I have access to ExpressionScript with the version provided by my university. I am attempting to find out which version it is but no one seems to have the answer!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago - 1 year 5 months ago #242982 by Joffm
Replied by Joffm on topic Conditions on more than one question

I do not think that I have access to ExpressionScript with the version provided by my university.

I am sure you have.
ExpressionScript is just a script, meaning you only have to type.
E.g. what I showed before.
You type it into the field "condition" (or "relevance equation"; the name was changed in version 5.x.)
 
Usually curly brackets indicate such a script - if you want to pipe values into a question, if you use an equation to calculate something.
Like this where you calculate a division and round it.
 

But in case of conditions the curly brackets already are symbolized, so no need to use them again

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 5 months ago by Joffm.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose