Program Indicator

Hello everyone

I would like support in creating a program indicator that counts the number of beneficiaries without at least one event in a given period.

Regards

1 Like

Thanks for the post! @dguambe it’d be very helpful if you add more details. Are the beneficiaries Tracked Entity Instances which means we will be counting the number of enrollments in the program? Or are the beneficiaries created as Data Elements?

It’s not clear when you say ā€œwithout at least one event in a given periodā€ Is that a program stage? or an event in a program stage? It’s not clear, are you trying to exclude a period or include the period? The period for enrollment or for the program stage?

Please clarify and it might also help if you explain the use case.

Thanks!

Hi @Gassim
Thanks for reply , please find the details

  1. The beneficiaries are Tracked Entity Instances
  2. ā€œwithout at least one event in a given periodā€ is an event in a program stage?
  3. are you trying to exclude a period or include the period - include the period enrollment period

Use case

I have a beneficiary receiving services during the year
I want to count the number of beneficiaries who received services in Q1 and did not receive any services during Q3

The program has only one stage

Thanks!

In this case, it means we want to count the number of enrollments that received event >= 1 in a certain period of time during a year. I can make a suggestion and might need your help in making it work so feel free to suggest to edit it or improve it please:

In the expression, we could do something like:

d2:condition("V{enrollment_status} == 'ACTIVE'",1,0)

and in the filter, I was thinking something similar to this:

V{event_date} < 'YYYY-04-01'

I mean by ā€˜YYYY-04-01’ as the beginning of the third quarter of the year. However, I’m not sure there’s a way to make it generic for each year (using YYYY doesn’t really work.)

If that’s complete we can then create the number of times 1 is returned by creating an Indicator. Although, this is not really successful considering the limitations; however, I propose if there’s another way to approach this? Are there other factors that we could add to the equations in order to make the distinction more possible?

Thanks!

1 Like

Hi @Gassim
It’s worked fine.

Thanks

1 Like

That’s great to hear. Would you share the expressions that worked? Thanks!

Hi @dguambe and @Gassim

A more generic solution would use analytic period boundaries with period offsets.

This allows for shifting of the program indicator window relative to the reporting period. You would not need to make a different program indicator for each quarter.

The example below would identify all enrollments with:

  1. enrollment dates 2 quarters before the quarterly reporting period (i.e. enrollments in Q1)
  2. event dates within the quarterly reporting period (i.e. services received in Q3)

To filter for enrollments without an event in Q3, you need to use a !d2:hasValue() with a mandatory data element: d2:hasValue(#{stageUID.MandatoryDatalementUID})

Expression is V{enrollment_count}

Note that because the boundaries are based on the length of the reporting period, you would need to be sure this is only used in data visualizer or tables where the period is quarterly

More details on such an approach in tracker design guide here

1 Like

Yes! Thank you so much for the explanation. I was wondering how a generic solution would work instead of a ā€œstaticā€ date. :slight_smile:

@dguambe please see the solution provided by @brian as it should help in the long run as well.

Thanks! :+1:

1 Like