Issue Adding up to 100

I have a form i have a select multiple question and there are certain integer fields which based on the responses selected in the select multiple question. It should add up to 100%. But the problem is as it is filtered. It is giving an error not add up to 100% even if it 100% as some of the fileds are filtered. when we select all the codes then it works fine. Also attaching the xls form for your reference.Channel_Satisfaction.xls (28.5 KB)

Your calculation:

c_jsales = ${J_sales_1}+${J_sales_2}+${J_sales_3}+${J_sales_4}+${J_sales_5}+${J_sales_6}

assumes all the individual sales have been entered and have a valid value. But if the corresponding choice was not selected in your select_multiple then some of these values will be blank (not 0!). And if you try to add a blank in an arithmetic expression you’ll get NaN.

Any optional values in arithemtic expression that may be blank/null have to be explicitly converted to 0. See

1 Like

Thanks coalesce work… That was what i required. Thanks a lot.

1 Like