I have used calculate to obtain the number of F_missed on a row then the next row number of M_missed then Total_missed which is the addition of the two. but if one of the result evaluate to zero it does not show under display the ${Total_missed} is. How do i resolve this?
What ODK tool and version are you using? And on what device and operating system version?
ONA What steps can we take to reproduce the problem?
What you have you tried to fix the problem?
Anything else we should know or have? If you have a test form or screenshots or logs, attach here.
Using the sample form you shared, the issue is if either c1 or c2 is zero (0) then the final result c3 will not display the value it is holding on the smartphone.
Also, if c1 is the one evaluating to zero it will not show on the smartphone. so c1 and c3 will not display the values they are holding
let me know if additional information is required.
@fathy
so my sample form is ok and you are able to reproduce the issue using that form? That would be strange because I'm not.
Please take a look at my steps and let me know what I am doing wrong:
Can't convert your xlsx file - no choices sheet. Couldn't you prepare a smaller form just for showing your problem? It's much easier if such a form contains only needed questions.
Your problem is that you use question Vaccinated2F and Vaccinated2M for calculations in question F_missed and M_missed but those first two questions might not be relevant. If they are not relevant the value is null not 0 as you probably assumed, so then in
F_missed you try to calculate ${F_eligible}- ${Vaccinated1F} - null
and in M_missed
${M_eligible} - ${Vaccinated1M} - null
what causes problems.
To fix the problem you need to use: ${F_eligible}- ${Vaccinated1F} - (if(${Vaccinated2F}=null, '0', ${Vaccinated2F})) for F_missed
and ${M_eligible} - ${Vaccinated1M} - (if(${Vaccinated2M}=null, '0', ${Vaccinated2M})) for M_missed