Hello,
I would like to have an IF condition that is able to return TRUE if the result is 15 and FALSE if the result calculated is less than 15 or more than 15. Below is the calculation that returns the number of days a complaint was registered and clossed.
int(decimal-date-time(${date2}) - decimal-date-time(${date1}))
Kal_Lam
December 14, 2021, 7:06am
2
You could do it as outlined in the image shared below:
In the survey tab of your XLSForm:
Data entry screen as seen in Enketo: when nothing is entered
Data entry screen as seen in Enketo: when the date differences are less than 15
Data entry screen as seen in Enketo: when the date differences is exactly 15
Data entry screen as seen in Enketo: when the date differences are more than 15
Reference XLSForm:
Calculate Days.xlsx (10.4 KB)
Thanks so much, though I am still getting a false irrespective of the result being equal to 15 days. See below;
First Calculate: ${num_days1} - 15
Second Calculate: if(${num_days2}=15,‘True’,‘False’)
Note: Case closed in 15 days?: ${true_false}
Where am i going wrong
Oh, it worked after I interchanged True and False.
Thanks so much!
1 Like
Kal_Lam
December 14, 2021, 3:38pm
7
Thank you for confirming!