Hi @banks,
That is because In the ODK Form Logic, unanswered number questions are nil. That is, they have no value. When a variable referencing an empty value is used in a math operator or function, it is treated as Not a Number (NaN
). The empty value will not be converted to zero. The result of a calculation including NaN
will also be NaN
, which may not be the behavior you want or expect.
To convert empty values to zero, you can use either the coalesce()
function or the if()
function.
coalesce(${potentially_empty_value}, 0)
if(${potentially_empty_value}=“”, 0, ${potentially_empty_value})
Thanks @hakan_cetinkaya for your feedback
However when i added this to my XLS form and uploaded
that is the error i got
Hi @banks,
You need to change “potentially empty value” with your own potentially empty values
Not exactly to “potentially empty value”
This is noted
However it seems don’t have unanswered questions in this particular calculation
Hi @hakan_cetinkaya
It seems am unable to upload an attachment since am a new member in the community
@banks, you should be able to upload your XLSForm to the community if you are still stuck with the issue.