← Back to team overview

dhis2-devs team mailing list archive

Re: DE Average aggregation type returns average of category options as Total

 

Hey Marta,

thanks for bringing this up.

I guess the naming of the aggregation operator "Average (Sum in hierarchy)"
is currently a bit misleading. It should perhaps have been "Sum (Average in
time)", as we currently sum across the category dimensions.

So yes, it can be argued that the current behavior is wrong. However I am
not sure if we should change it (perhaps instead alter the name of the
operator). A typical use-case for this aggregation operator is population
or staff data. Think about a case where HR data is collected quarterly at a
facility:

*Quarter 1*
Doctors: 10
Nurses: 10

*Quarter 2*
Doctors: 10
Nurses: 10

*Quarter 3*
Doctors: 20
Nurses: 20

*Quarter 4*
Doctors: 20
Nurses: 20

Here HR/staff is a data element, and the types of staff are category
options.

In this case, when aggregating for the year and for an entire country, you
could like the aggregated value for the HR data element to be 30, by
summing up the org units and category options, but averaging across the
quarters.

Do you have a specific requirement for the behavior where you need to sum
in the org unit hierarchy and average across all other dimensions, or is it
more to point out unexpected behavior/possible bug? I am willing to rename
the aggregation operator to make it clearer.

Would be interesting to get others input on this as well.

best,

Lars






On Wed, Jan 11, 2017 at 11:48 AM, Marta Vila <martavila@xxxxxxxxx> wrote:

> Hi all,
>
> we have observed that when we set aggregation type in a DE collected with
> category options, when we ask for the total value we obtain the average of
> the values introduced in each category instead of the sum.
>
> Please see the example bellow. It is configured and tested in the demo
> server now. It will disappear tomorrow... I'm sending also screenshots.
>
> We would like to know if this is the intended behaviour before reporting
> it in Jira.
>
> Cheers,
>
> Marta
>
> *Configuration of DE: *
>
> *Test_HIV_Average* has aggregation type Average
> *Test_HIV_AverageSum* has aggregation type Average (sum in hierarchy)
>
>
> *Data entered*
>
> [image: Inline images 2]
>
>
> *Resulting values*
>
> Please notice that we are not aggreating in this examples, neither in time
> or hierarchy.
>
> Pivot table Test Average Aggregation - Totals
> https://play.dhis2.org/demo/dhis-web-pivot/index.html?id=R27At0VRELN
>
> [image: Inline images 1]
> Pivot Table Test Average Aggregation - Details
> https://play.dhis2.org/demo/dhis-web-pivot/index.html?id=XIkxuP2unBJ
>
> [image: Inline images 2]
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
lars@xxxxxxxxx
http://www.dhis2.org <https://www.dhis2.org/>

PNG image

PNG image

PNG image


Follow ups

References