How do i use choice filter to select what has not been selected in the previous question?

Dear all,

I have exactly the same problem. I have the inverse logic though: the answer options in the second question should be the ones that respondents did not select in the first question. In both cases, i want the ‘none’ answer option to appear. I tried to replicate the logic that Kal_Lam did in his Choices V2 document. However, for me, it is still not showing ‘none’ in the second question. I also tried to add in Khasaab’s solution, but it’s not working neither. Could someone please help me out?

Hi @YvonneREACH,

Welcome to the community! Would you mind having a look at the post discussed previously (it should solve your issue):

Have a great day!

Thank you Kal_Lam, I had a look at the link you sent. I literally copy pasted that in and adapted it. However, the ‘none’ option is still not appearing. It is because ‘none’ is appearing in the first set of answer options, so according to this logic, it would not show in the second set of answer options. I need a more specialized logic. I have spent 3,5 hours on this issue, and I went over so many threads here. I tried to adapt it to a previous suggestion that you made Kal_lam (How do i use choice filters to select what has been selected in the previous question along with an additional none choice (in Q2)?), when I adapted it with my labels, it didn’t work unfortunately.
However, I can not upload a file here, because it says new users can not upload a file?

Hi @YvonneREACH,

And what if none is selected in Q1? Do you still require them in Q2?

Have a great day!

Dear Kal_Lam,

Thank you so much for taking the time to respond to my messages.

That is correct, if none is selected in Q1 (Which of the following items do you currently sell?) then ‘none’ should also appear in Q2 ( Which one of the items you are not selling is available elsewhere in the marketplace?).

Currently my choice_filter is:
not(selected(${items_available_food},name)) or
selected(${items_available_food},‘wheat_local’) and (name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘wheat_imported’) and (name=‘wheat_local’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘local_rice’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘veg_oil’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘pulses_lentils’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘pulses_beans’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘pulses_split_peas’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘salt’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name =‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘sugar’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘tomatoes’ or name=‘potatoes’ or name=‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘tomatoes’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘potatoes’ or name=‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘potatoes’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘onions’ or name=‘eggs’)
and selected(${items_available_food},‘onions’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name=‘eggs’)
and selected(${items_available_food},‘eggs’) and (name=‘wheat_local’ or name=‘wheat_imported’ or name=‘local_rice’ or name=‘veg_oil’ or name=‘pulses_lentils’ or name=‘pulses_beans’ or name=‘pulses_split_peas’ or name=‘salt’ or name=‘sugar’ or name=‘tomatoes’ or name=‘potatoes’ or name=‘onions’)

Hi @YvonneREACH,

Could you share your xlsform with only the selected questions so that the community could help you out.

Have a great day!

Thank you so much for offering. I’d love to but when I try to upload the xlsform, it says ‘Sorry, new users can not upload attachments’ ? Is there a way I can share it online?

Thank you so much in advance, and have a great day too!

Here is a link to the questionnaire, but I’m afraid you want to see the ‘backside’ of it?
https://enketo.getodk.org/preview?form=https://xlsform.getodk.org/downloads/t26h5fhf/example_market.xml

Update: i tried ‘not(selected(${items_available_food},name)) or name =‘none’’ and this seems to be working now. Thank you Kal_Lem for your participation in this thread.

1 Like

Hi
Can you try uploading the XLS form now.
Stephane

1 Like

example_market.xlsx (11.5 KB)

Thank you Stephane for upgrading me! But the issue seems to be solved now with an easier logic (see previous thread). Thank you Kal_Lam and Stephane!

2 Likes

Hi @YvonneREACH,

Thank you for sharing the solution to the entire community! Expecting the same in the upcoming days as well.

Have a great day!

1 Like

This is great work from community which rescued me today…
Thank you all contributors

1 Like

Hi @dawazangpo
You are welcome to the community. Feel free to share your positive experiences as well as the queries you have.

Stephane

2 Likes