Using select_multiple on XLSform

Hi all,
I am a new ODK user. I'm using ODK to develop an emergency triage application as part of masters research. When developing the form on XLSform, I encountered a problem with a select_multiple question; selecting more than one option does not give me the required output in my calculation. Whereas choosing just one gives me the right answer. How do i get around this?
Thank you.

Hi @Tsholofelo_Molefi

you have to share you form and let us know how your calculation looks like. We can't say what's wrong without an example.

Hi @Grzesiek2010
Thanks for you r response. I have uploaded my form. The section in my form where my users have to select multiple discriminators when they triaging and the calculation is where the problem lies, ie. rows 54 and 55.

Thank you.Triage_ODKrevised.xlsx (18.1 KB)

Your calculation will not work in case of multiple select. Can you please explain more what output you actually want in row 54 and 55.

1 Like

My aim is for the application to categorize patients into different colours based on the selected discriminator. Discriminator1, which classifies patients into 'red' category holds the highest priority, followed by discriminator2, 3 and 4 which are orange,yellow and green respectively. So that if there is more than one selection then the highest category should be the outcome in row 54.

I hope this makes sense. Thank you.

Try this:

if (${discriminator1}!='', 'red', if(${discriminator2}!='', 'orange', if(${discriminator3}!='', 'yellow', if(${discriminator3}!='', 'green', 'none'))))

Basically, ${discriminator1}!='' (ie discriminator1 is not null) will test whether anything was selected. If so then return its colour. If not, then continue to check remaining discriminators in descending order of priority.

Hi @Xiphware,
I tried what you suggested and it works! Thank you very much for your help.

YW, glad its working for you.

Please remember to close out any questions (as "solved") once you have a working solution; it greatly helps the over-worked, underpaid, ODK support staff quickly identify which problems folks are still struggling with :wink:


@Xiphware I'll remember to do that in future.

Thanks again!

1 Like