Skip logic and/or

Hi all,
Can I use ‘and’ and ‘or’ used together in a one logic.

Hi @pyonethazin,

Indeed you can :slight_smile:

1 Like

But it didn’t work when I try. Could you explain, plz?

I can try to help you with that. Can you show a screenshot of your skip logic?

Are you using KoBo Toolbox’s internal editor or are you using xml file to add your skip logic?

1 Like

Screenshot 2022-02-04 181031

I want to do like this.

Hi @pyonethazin,

I can’t see the full screenshot, can you share it again?

1 Like

@pyonethazin, maybe you will need to try this out:

${price} !='' or (${occupation}='farmer' and selected(${crop2}, '1'))

Note: you will need to use selected(${crop2}, '1') instead of ${crop2}='1' as crop2 is a select_multiple question type.

1 Like

Thank you, Kal Lam.

1 Like

Hello,
To add: “or” and “and” must always be separated by brackets…

1 Like

If I want to answer this question except farmer and 1, can I write that with NOT
like that

${price} !=’’ or not(${occupation}=‘farmer’ and selected(${crop2}, ‘1’))

Thank you.

1 Like

You could play around.