Welcome to the LimeSurvey Community Forum

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

Logic with [group of checkboxes] questions

  • seanmd
  • seanmd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 5 months ago #113475 by seanmd
Hi all,

I'll just quickly explain the survey question I'm trying to fix the logic for.
The question in my survey is: "For which of the following reasons, if any, do you use self-monitoring of blood pressure?" And the answers are:
- For diagnosis of hypertension (1)
- To exclude or confirm white coat hypertension (2)
- To exclude or confirm masked hypertension (3)
- To monitor control in treated patients (4)
- As an aid to medication adherence (5)
- As an aid to lifestyle change adherence (diet/exercise) (6)
- Other (please specify)
- None of the above

I'm trying to make the logic to the question such that if they answer a question with multiple choices:
- 1 OR 3
- 1 AND 3
Then they will be shown different questions later in the survey. However, it seems that with [group of checkboxes] style questions it only allows me to write it as "1 OR 3", and doesn't allow me to write it as "1 AND 3". Is it possible to do this?
I've attached a photo so that it might make a bit more sense.

Can you please help? Thanks very much!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 5 months ago #113476 by holch
Replied by holch on topic Logic with [group of checkboxes] questions
There are two options: you write two conditions, one for 1 and one for 3.

Or, and I would recommend to do this: Learn how to use relevance equations and you can write something like this:
Code:
b6==SQ001 OR b6==SQ003

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: seanmd
The topic has been locked.
  • seanmd
  • seanmd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 5 months ago #113478 by seanmd
Replied by seanmd on topic Logic with [group of checkboxes] questions
Hi Holch,

Thanks very much for the help. I'm still a bit confused though, because when I write two different conditions Limsurvey automatically puts the operators OR or AND for you like it says in the manual:

"However, it is important to understand that LimeSurvey automatically determines which logical operator to apply: this means that the use of the OR or AND operators is determined according to the context of the condition."

Is there a simple way around this? I.e. can I change the OR to an AND? Or do I need to write a relevance equation like what you've written?
The topic has been locked.
  • seanmd
  • seanmd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 5 months ago #113506 by seanmd
Replied by seanmd on topic Logic with [group of checkboxes] questions
Please ignore above message, I managed to figure it out in the end! Thanks again :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose