Select to view content in your preferred language

Calculation from a select_one question to choose select_multiple answers

681
5
09-28-2023 09:19 AM
StevenHughes44
Emerging Contributor

I have survey that creates test request forms and I want to select answers from a select_multiple question based on the answer of a select_one question.  The formula I'm using is from an existing post and is laid out like this:  if(selected(${test_req},'DOT'),'UrineLab,OralRapid,',")

When I save the file, I get a "couldn't understand the expression starting at this point: ...ab,OralRapid"

I have attached the source file for review.

0 Kudos
5 Replies
DougBrowning
MVP Esteemed Contributor

Try a space vs a comma since that is how select multiple are stored (and why the values can't have spaces).

if(selected(${test_req},'DOT'),'UrineLab OralRapid,',")

Hopefully that does it

0 Kudos
StevenHughes44
Emerging Contributor

Thanks for the reply.  I'm still getting the same error message after making the change you suggested.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Opps sorry you had an extra end comma I forgot to remove

if(selected(${test_req},'DOT'),'UrineLab OralRapid',")

0 Kudos
StevenHughes44
Emerging Contributor

Thanks again.  However, I'm still getting the same error.

0 Kudos
DougBrowning
MVP Esteemed Contributor

You had the last double single quote as one double quote instead. 

Also it is a comma - sorry been a bit on that.  

Your sheet keeps adding a lead ' to the formula and I do not know why.  Some type of corruption.  Changing to all double quotes helped but not sure what is up.

The formula should be - note I moved it right to the field and removed ${calc} totally.

if(selected(${test_req},'DOT'),"UrineLab,OralRapid","")

Your excel may have issues.  Hope that works

0 Kudos