We have a requirement to calculate the number of AGYW who received an HIV test in a specific period, regardless of when they are enrolled in the program (the requirement is for both quarterly and 6-monthly reports). I looked at the very useful ppt that @brian created here and my use case should meet slide 9 so I have set up a PI that uses Analysis type = Enrollment, Boundery:
Event date before end of period no offset or period type
Event date after start of period no offset or period type
Enrollment date before end of reporting period no offset or period type
The values are displaying, but it is displaying against the enrollment period because we are selecting analytics type = enrollment. So instead of showing report for e.g. Q3 2025 the values are split between Q2 and Q3 because some enrollments were in Q2. How do I get this to show in the period when the events occurred but still count only individual cases if there were more than 1 event for an enrollment within the period?
Also, maybe just remove the enrollment date boundary. It seems quite unlikely that you will have eventDates that will be earlier than the enrollment dates. (I do not know your use case, of course).
@Elmarie_Claasen If the HIV test is recorded as an event and you want to count the number of AGYW who had that event in a specific period, then I think you might actually want to go for:
expression: V{tei_count}
Analytics type: Event (with the default period boundaries)
The event analytics type will make sure the calculation is only run on AGYW TEIs that have the HIV test event in the analytics period, and the TEI count expression will make sure each AGYW is only counted once, even if they have multiple HIV tests within the analytics period.
If the AGYW only has a single enrollment, then V{enrollment_count} and V{tei_count} will give the same result, but I think V{tei_count} conveys the meaning of what you want more clearly.
Here is a slide deck in which I explain how we were troubleshooting this issue and actually found that there is another scenario for that one could add to the presentation @brian
Your solution looks good, but just as an extra wrinkle to @plinnegan ‘s comment above:
the TEI count expression will make sure each AGYW is only counted once, even if they have multiple HIV tests within the analytics period.
With event type analytics, each AGYW will be counted only once per orgunit-period combination in your analytics query. The problem comes if an AGYW can receive a test from different orgunits within the same period. In that case, when you look at a “long” pivot table of tests per facility this month, the sum of that table may be larger than the result when you make a query at national level.
I have more such slides here , and go into more detail on aggregation challenges in the Tracker Analytics design guide.