Using answers to multiple-select question in calculation of another question

393
2
Jump to solution
09-15-2021 02:57 PM
PrachiPatel
New Contributor III

I have a select multiple question, where a submitter selects all the alternative water supplies they will use on their site. Then I want to calculate total supply they have available on their site depending on the answers they select.

PrachiPatel_0-1631742872056.png

For example in the screenshot above, if the submitter selects Rainwater and Stormwater, I want the rec_sav to have the calculated value of ${RW} + ${SW}. How do I format the calculation when it is dependent on the answers to multiple-select question that get stored as comma separated values?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

I think contains would be your friend here.

if(contains(${selectmultiplefield}, "Rainwater") and contains(${selectmultiplefield}, "Stormwater"), ${RW} + ${SW}, else not sure what you want here)

You could also always calc it and instead use relevant to show the whole field it only if they are checked.  The relevant would use contains just like above.

Hope that helps

View solution in original post

2 Replies
DougBrowning
MVP Esteemed Contributor

I think contains would be your friend here.

if(contains(${selectmultiplefield}, "Rainwater") and contains(${selectmultiplefield}, "Stormwater"), ${RW} + ${SW}, else not sure what you want here)

You could also always calc it and instead use relevant to show the whole field it only if they are checked.  The relevant would use contains just like above.

Hope that helps

PrachiPatel
New Contributor III

@DougBrowning Worked like a charm, Thanks!