Requesting community's support on the total computation not appearing in the form

Hi Kobo Community, I badly need your help as Iam facing difficulty figuring out why the computation result couldnt seem to appear in the form I developed for an assessment.

In the form, we are aiming to compute for a total cost of items based on the quantity and Price per item and I used this computation formula: ${SMatfam_Qty}*${Price_SMat_Family}

As I want to make it appear in the form, I used this formula: ${total_SMatfam}

However, i couldnt make the total cost appear. and it only shows Nan so I thought maybe there’s an issue with the formula. But looking at the other item, the cost is actually working.

Hope you can help me. Thanking you all in advance.


Welcome to the community, @pmo_kobo_toolbox_dat! Try using the coalesce function outlined in our previous post, which should solve your issue.

You should also be able to learn more about the coalesce function through these community posts.

A select_one values are stored as string, so you may need to cast it to number() Also, make sure that all parts of the decimal calculation are required = true (or yes), otherwise you need to add coalesce() function. See ODK XForms Specification.

1 Like