I have a hidden value that calculates the number of days between visits. This hidden value in the case list details.
I would like to show two icons: a green icon if the number of days is above zero and a red icon if the number of days is below zero as a way to alert the chw to the followup visits. Is there a way of doing this on commcare?
I read the page and it was really helpful, but I get an unexpected result in the nested if statement below:
if (next_visit_date < -5, “red”, if(next_visit_date >= -5 and next_visit_date <=5, “yellow”, if(next_visit_date >5, “green”, ''))).
next_visit_date is a hidden value that calculates the number of days between visits. The is problem is that the first two conditions are never met in the expression. I get green as the result even if the number of days are below zero.