Difficulty with complex skip logic

We are conducting a household survey about malaria in Kobo. I have a complex skip pattern that I’m trying to create for a particular question, where the question should only be displayed if any of several variables are equal to a certain value AND if one other variable is equal to a certain value. Here is what I’ve written in excel:

(${nhc_mulo_zam} = ‘9’ or ${nhc_mulo_zam} = ‘10’ or ${nhc_mulo_zam} = ‘5’ or ${nhc_mulo_zam} = ‘4’ or ${nhc_mulo_zam} = ‘1’ or ${nhc_mulo_zam} = ‘6’ or ${nhc_mulo_zam} = ‘11’ or ${district_wes_zam} = ‘1’ or ${village_muk_zim} = ‘30’ or ${village_muk_zim} = ‘29’ or ${village_sab_zim} = ‘5’ or ${ward_hwa_zim} = ‘1’ or ${constituency_omu_nam} = ‘1’ or ${village_out_nam} != ‘20’ or ${village_out_nam} != ‘37’ or ${village_out_nam} != ‘29’ or ${village_out_nam} != ‘28’ or ${constituency_oha_nam} = ‘1’ or ${village_osh_nam} != ‘5’ or ${village_oko_nam} = ‘7’ or ${village_oko_nam} = ‘20’ or ${village_oko_nam} = ‘9’ or ${village_oko_nam} = ‘3’ or ${village_oko_nam} = ‘10’ or ${village_oko_nam} = ‘15’ or ${village_oko_nam} = ‘14’ or ${village_oko_nam} = ‘26’ or ${village_oko_nam} = ‘19’ or ${village_oko_nam} = ‘18’ or ${village_oko_nam} = ‘16’ or ${village_oko_nam} = ‘4’ or ${village_oko_nam} = ‘24’ or ${village_oshikunde_nam} != ‘8’) and ${irs_p12mo} = ‘1’

However, the question still is appearing even when it’s not supposed to.
Any ideas?

Thank you!

Welcome back to the community, @amaglior! Could you share with the community the 2 sample questions in its XLSForm so that the community should also be able to have a closer look and help you out? PLEASE SHARE ONLY THE RELEVANT QUESTIONS!

Hi @Kal_Lam thanks for your response. There are so many questions to list…several questions asking which village the survey is being conducted in (since this is a multi-location survey).

I think the core of my question is this; can you have skip logic in Kobo that only displays a particular question IF the answer =1 for ANY of several variables AND if the answer=1 for a different variable. Once you input the skip relevance into Kobo, the two options provided by Kobo are “must be ANY of these” or “must be ALL of these.” Neither of those apply to my situation because it’s both - ANY of several variables AND another variable. Is that possible to do in Kobo? In other platforms, like Qualtrics, this is easily done by putting “or” or “and” in between each individual constraint, whereas Kobo allows only ALL or ANY to all of the constraints. I hope this makes more sense.

Hi again @Kal_Lam , I figured this out after a lot of trial and error. If you look closely at the syntax above, you’ll see that the criteria I listed includes both “equal to” (=) and “not equal to” (!=). I changed them all to “equal to”, put one set of parentheses around all of the “or” criteria and then had the last “and” criteria at the end. Now it works as I wanted it to. Hope this helps someone else in the future.


@amaglior, thank you for sharing this solution to the entire community :clap: :heart: :partying_face: