# Logic with [group of checkboxes] questions

4 years 1 week ago #113475 by seanmd
seanmd created the topic: Logic with [group of checkboxes] questions
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)
- 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.

##### Attachments:

4 years 1 week ago #113476 by holch
holch replied the 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:
`b6==SQ001 OR b6==SQ003`

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
The following user(s) said Thank You: seanmd

4 years 1 week ago #113478 by seanmd
seanmd replied the 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?

4 years 1 week ago #113506 by seanmd
seanmd replied the topic: Logic with [group of checkboxes] questions
Please ignore above message, I managed to figure it out in the end! Thanks again