Aggregation Type: Last Value, Sum in Organisation Unit Hierarchy

https://baosystems.atlassian.net/wiki/spaces/SOL/pages/3411640321/Aggregation+Type%3A+Last+Value%2C+Sum+in+Organisation+Unit+Hierarchy


"Last value, sum in organisation unit hierarchy" is one of the aggregation types provided by DHIS2. Let's break down this aggregation type step by step:

  1. Last Value: When data is aggregated over a period (like monthly, quarterly, or yearly), instead of summing all the individual data values, DHIS2 will take the last reported value for that period. This can be useful in scenarios where the most recent value is the most relevant, such as stock levels of a vaccine. If you're tracking the quantity of vaccines in storage every week, at the end of the month, you'd probably be most interested in the most recent count, not the sum of all weekly counts.
  2. Sum in Organisation Unit Hierarchy: This refers to how data is aggregated up the organizational unit hierarchy. DHIS2 has a hierarchical structure for organizational units, which can represent levels like districts, provinces, and countries. When aggregating data from lower levels to higher levels, DHIS2 will sum the last values of all the lower-level units. For instance, if you are viewing data at a provincial level, DHIS2 will sum the last reported values from all the districts within that province.

To give a concrete example:

  • Imagine three districts A, B, and C in a province.
  • At the end of a month, the last reported vaccine stock levels for A, B, and C are 100, 150, and 200, respectively.
  • When viewing data at the provincial level using "Last value, sum in organisation unit hierarchy" aggregation, the value for that province will be 450 (the sum of 100, 150, and 200).

When would one use it? This aggregation type is suitable for metrics where:

  • The most recent value in a period is the most relevant.
  • You need to sum these last values across a hierarchy when viewing at higher levels.

Examples might include stock levels of supplies, the latest patient count in a ward, the most recent water quality reading in a month, etc. Essentially, it's useful when periodic totals or averages are not meaningful, but the most recent status (the "snapshot" at the end of the period) is, and you want to aggregate these snapshots across organizational units.