Using choices for two different questions with choice filter with exception

What is the problem? Please be detailed.
Hi, I am currently designing a survey using xlsform on excel. I have two questions

  1. What is your main income
  2. What are you additional sources of income? (which uses the same list as before).

I have used the choice filter column to prevent the same option from being chosen twice which works great! However, for one of my options (farming) I would like to be able to use it in both questions (as in farming for one crop as a main source of income and farming in the second question for additional crops).
My question is can I use a choice filter with an exception of the farming answer?

This is the current choice filter I have:
name != ${income_main}

You can use if-else like:
if(selected(${q1},'farming') , first_choice_filter, second_choice_filter)

Hello thank you so much for that,
would that just be added on to my initial code in the choice filter column using and?


Yes you can use if-else in choice_filter column.


I am still a little confused how to use it. I keep getting error messages. what would the final code look like?
is first_choice_filter the name of one of my variables?

I have used the choice filter column to prevent the same option from being chosen twice which works great!

that choice_filter you should put instead of second_choice_filter in:

first_choice_filter - I'm not sure because you didn't share any sample form but probably it could be empty or an edited version of that one you already prepared.

Share your form in case of any problems.

Hello please find attached example code, thanks for all your help .

ODK_Help.xlsx (32.5 KB)

It could be like this:
if(${income_main}='k' , name != ‘’, name != ${income_main})

ODK_Help.xlsx (8.8 KB)

Thank you so much, works great!

Dear @Grzesiek2010
I have two scenarios in my survey

  1. I have created a choice filter from questions 2.1, 2.2, 3.2, and 3.3 if you select TPA HQ in qn # 2.1 the filter is going smoothly.
  2. The second scenario is when you select 2.1, and 2.2 we need to skip 3.2 if the selected choice is not equal to TPA HQ. so when you select dar port up to end except TPA HQ you need to go to qn number 3.3.
    I need your help and see the attachment below
    version 1.xlsx (26.2 KB)