Hello.
Is there a way to remove the ‘NaN’ text that appears in calculated fields until a number is entered? Can it just appear blank (or some other label) until the other fields are populated to create a calculation?
the ‘NaN’ is confusing people completing the survey.
Any arithmetic calculation expression that consumes fields which may be (initially or otherwise) blank must explicitly interpret blanks as 0, otherwise you will get “NaN”. See https://docs.opendatakit.org/form-logic/#empty-values-in-math for prescribed solution.
Hi. I tried both examples from the link you provided, but both caused ‘NaN’ to appear twice instead of once. I replaced potentially_empty_value with my variable.
I tried
if(${potentially_empty_value}="", 0, ${potentially_empty_value})
and
coalesce(${potentially_empty_value}, 0)
but neither worked. They belong in the calculation column, correct?