# Average population count scenario - Program indicator over multiple and varied survey days

**URL:** <https://community.dhis2.org/t/average-population-count-scenario-program-indicator-over-multiple-and-varied-survey-days/60342>\
**Category:** Support - Assistance technique\
**Tags:** programindicator, indicators\
**Created:** [5 August 2024 11:52 UTC](https://community.dhis2.org/t/average-population-count-scenario-program-indicator-over-multiple-and-varied-survey-days/60342 "2024-08-05T11:52:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terence\_Scott](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/terence_scott/32/26898_2.png) [@Terence\_Scott](https://community.dhis2.org/u/Terence_Scott)\
**Post date:** [5 August 2024 11:52 UTC](https://community.dhis2.org/t/average-population-count-scenario-program-indicator-over-multiple-and-varied-survey-days/60342/1 "2024-08-05T11:52:09Z")

</div>

Dear All

I have been having some troubles with determining the average (mean) of event counts over a period of time.

In our current example, we are doing population counts each day for an event-based program. However, we need to determine the average of the population counts within a month. The trick is that the number of counts in a month may vary per site.

For example, we may have the following situation in Month 1 in survey site 1:  
Day 1 (1 August): 20 people  
Day 2 (3 August): 30 people  
Day 3 (12 August): 70 people

Month 2 in survey site 1 may be:  
Day 1 (12 September): 20 people  
Day 2 (13 September): 30 people

I need to determine the average population count per month for each survey site. In this particular example, I can create a program indicator that determines the total count per month (thanks @Gassim ). In this example for Month 1, it would be 120 people. The next step would be to determine the average. That is easy to calculate (i.e., 120/3 = 40). However, it is not possible to do “Event count where event date is unique” in DHIS2 in any way that I could figure out.

I think I may have determined a workaround though, but I am wondering (and hoping) whether there is a more elegant and less convoluted way to do it.

We would add in a data element called “Survey day” with options of “1”, “2”, “3”, etc.

I would then need to create a program indicator that was set to “Count” with the following expression:

**Program indicator 1:** _V{event\_count} – (V{event\_count} – 1) and Filter “Survey day” == “1”_

**Program indicator 2:** _V{event\_count} – (V{event\_count} – 1) and Filter “Survey day” == “2”_

**Program indicator 3: …. Etc.**

That would give me a value of 1 if there is any data associated with that survey day. I would then repeat this for all survey days.

I would then need to create an Indicator as follows:

_total events per month / (sum(Program indicator 1, Program indicator 2, Program indicator 3, etc.)_

I would need to add in a condition: “Program indicator 1 \>0” to avoid dividing by “-1” (if the survey day has no data).

I understand that this is extremely convoluted and confusing, but I have been wracking my brain and searching through the documentation to try to find a solution (by the way, the AI helpbot in the documentation is great!). Could anyone assist?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Gassim](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/gassim/32/35347_2.png) [@Gassim](https://community.dhis2.org/u/Gassim)\
**Post date:** [6 August 2024 18:05 UTC](https://community.dhis2.org/t/average-population-count-scenario-program-indicator-over-multiple-and-varied-survey-days/60342/3 "2024-08-06T18:05:51Z")

</div>

Hi

> [@Terence\_Scott](#):
>
> it is not possible to do “Event count where event date is unique” in DHIS2 in any way that I could figure out.

Okay, so the unique day is the “survey day” which could be any day during the month. And if I understand correctly the main idea for using “survey day” is to pick out which days have event and which don’t, so why not use the condition that event\_date is not null?  
In the case where you specify that the event\_date is not null then you will only need one program indicator because it will already have the total event\_count where the event\_date (a survey day) is not null.

Does this make sense or did I miss something?

Thanks!

---

<div class="post-metadata">

**Author:** ![Terence\_Scott](https://dhis2.b-cdn.net/user_avatar/community.dhis2.org/terence_scott/32/26898_2.png) [@Terence\_Scott](https://community.dhis2.org/u/Terence_Scott)\
**Post date:** [7 August 2024 12:35 UTC](https://community.dhis2.org/t/average-population-count-scenario-program-indicator-over-multiple-and-varied-survey-days/60342/4 "2024-08-07T12:35:07Z")

</div>

Thanks @Gassim

Unfortunately (and if I am understanding correctly), your suggested solution will count the total number of events in a month, as every event will have a date associated with it. Because there are multiple events captured under each “Survey day”, this solution (using “event\_date is not null”) will simply provide a total event count (i.e., 120 in the ‘Month 1’ example I provided above).

What I need to achieve is to determine the average number of events captured per month, depending on how many survey days there were. So it would be 120/3 = 40 for the ‘Month 1’ example I provided.

The ‘Average’ indicator type doesn’t work as it considers the number of events as the denominator, providing an answer of 1 (i.e., 120 / 120). I need it to count how many survey days there were (i.e., 3) to provide the correct denominator to create the average (120/3).

I understand this is super confusing so I really appreciate your (and anyone else’s ) help.
