Program Indicator comparison of current period with previous periods

Hi Community,

I need some help with a Program Indicator - I have a event data element in a repeatable stage, which I need to count if it is yes in the reporting period and also yes in a previous reporting period. I know one can use period offsets only in Indicators and not in program indicators and I do not see how to use analytics period boundaries that looks at whether the element exist in 2 separate periods.

Any ideas how I can achieve this?

Thank you
Elmarie

1 Like

Hi @Elmarie_Claasen

Thank you for your post. Technically there is no way to achieve exactly this ('value from previous period AND at the same time the value from current period in one program indicator). You’re correct, the analytics period boundaries work within one reporting period, and the periodOffsets are only in the aggregate model.

If the program stage is repeatable and once in each reporting period for each enrollment then you could use a program rule that gets the value of the data element from the previous event which will help you fill a data element that can be used along side the other ‘yes’ DE in a Program Indicator.

If that is not the case, and if the event is not repeated only once per reporting period, then it’s not clear how you could do this using program indicators. I think we will either have to create a feature request (ideas) or find a work-around. It would be greatly helpful if you could explain more about the use-case itself as well as exact details of the metadata configuration such as how events occur, the period type..etc

It sort of feels that this might be one of those use-cases where Data Exchange (tracker to aggregate) could be useful. :thinking:

Hi @Gassim
The use case is as follows:
I have a tracker program for a tracking people with or at risk of HIV, with a repeatable stage for a Risk assessment and I want to count people who have attended a repeat risk assessment in the period. E.g. if the report is quarterly I want to count people who have attended in this quarter and also in the last quarter. I am not able to do Program Rules to fill in a helper field because the capturing is happening in an external application to DHIS2.

1 Like

Hi Elmarie,

Thinking through your use case, I agree, I think its not possible with current PI expressions.

If you had access to program rules for helper functions, then you could try:

  • When the DE value is Yes, use a PR to write the event date into a new helper DE, “date of Risk Assessment”
  • Use PR to carry over this data element value from previous event to next event, in a DE “date of previous Risk assessment”
  • Use analytic period boundaries, the DE value “date of prev risk assessment” within prior period, and the event dates within present period. In filter, Risk As. DE == Yes
    ^ this assumes you should only have 1 Risk Assessment per quarter.

If nesting expressions for dates worked better in PR, you could consider more complex logic, to make sure at least one event is in previous period and one is in current period. I drew this out using a combo of d2:addDays(), d2:daysBetween(), and V{analytics_period_start} , but alas, it doesnt pass expression parser.

Please create a feature request in Jira, this would be a good use case to build out comparisons across periods.

1 Like