Creating Program Indicators that compares days/weeks between dates

Hello everyone.

I’m currently creating a program indicator that should count events where days between event date and estimated date of delivery should be less than 224 days but more than 196 days.

Right now the expression is event count and the filter is d2:daysBetween(estimated_delivery_dataElement, event_date) >= 196 && d2:daysBetween(estimated_delivery_dataElement, event_date) <= 224

While above expression in filter is not working properly, the following expressions work. But neither do the work required for adequate analysis.

  • d2:daysBetween(estimated_delivery_dataElement, event_date) >= 196

OR

  • d2:daysBetween(estimated_delivery_dataElement, event_date) >= 196 || d2:daysBetween(estimated_delivery_dataElement, event_date) <= 224

Any thoughts or suggestions on how to go about this?

Hello,
I think your filter will not return any values because there is no intersection between the 2 conditions (there are no values that satisfy both conditions)
example:
let x = d2:daysBetween(estimated_delivery_dataElement, event_date)

then
x <= 196 means values below 196 (195, 194, 1, etc) while
x >= 224 means values above 224 (224, 225, 1000 etc)

Therefore there are no values that satisfy both conditions.

Perhaps you should try:

d2:daysBetween(estimated_delivery_dataElement, event_date) >= 196 && d2:daysBetween(estimated_delivery_dataElement, event_date) <= 224

Regards.

1 Like

Thanks @nnkogift but thats, a mistake in my expression on this topic. I’ll update that now, but my program indicator isn’t working with >= 196 and <= 224.