Automatically calculate the total

1. What is the problem? Be very detailed.

2. What app or server are you using and on what device and operating system? Include version numbers.

3. What you have you tried to fix the problem?

4. What steps can we take to reproduce the problem?

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Check this documentation https://docs.opendatakit.org/form-operators-functions/#operators

checked out the site but it dint assist it is still not working...any assistance further please

Hi @bob,

You need to add a calculated field in which you add the variables male and female.
${male} + ${female}

You can then recall the value in the total field by using the "${}" operator.
E.g. If you call the new variable "sum", you would then then type ${sum} in the label field.

I hope this helps!

Best,
Andrea

I would add to @Andrea_Martin's correct response that if any of your fields are non-mandatory/optional (ie may be empty) that you must explicitly treat blank values a 0, otherwise your total calculation will result in 'NaN' (literally, "not-a-number"...). See https://docs.opendatakit.org/form-logic/#empty-values-in-math for details.

1 Like