dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #47763
Re: Average Sum in Org unit Hierarchy
Hi David,
the way the average+sum aggregation works is roughly this:
sum( [days in data period] X data value ) / [days-in-aggregation-period]
In other words, we take the sum of the product of no of days in the data
value period and data value, divided by no of days in aggregation period.
Data value period is the period for which the raw data is collected (weekly
in your case). Aggregation period is the period which is requested in
analytics (monthly and quarterly in your case).
So in this case, the problem is that you capture data by weeks which in
reality represent bi-weeks - this confuses the aggregation output. The
holes in the data (you have many weeks without data) will pull down the
average score. Based on the rules outlined the results seems correct from
what I can see.
We could rather look into adding support for a bi-weekly period type.
best regards,
Lars
On Wed, Nov 16, 2016 at 2:24 PM, David Muturi <dnmuturi@xxxxxxxxx> wrote:
> Hi Lars,
> Many thanks for your response, since we do not have biweekly defined as a
> dhis2 period type(which would be great to have), we have configured the
> dataset to be weekly but only that data is entered on a biweekly basis,
> meaning one week will miss data while another will have based on when it
> was collected. I have attached an excel download from the datavalues table
> as well as a screen shot showing the weekly periods that data is collected.
> rgds
> David
>
> 2016-11-16 14:08 GMT+03:00 Lars Helge Øverland <lars@xxxxxxxxx>:
>
>> Hi David,
>>
>> sounds strange indeed. We need some more info. Can you include bi-weekly
>> periods in your screenshot so that we can see what the original captured
>> value is?
>>
>> regards,
>>
>> Lars
>>
>>
>>
>> On Mon, Nov 14, 2016 at 8:50 PM, David Muturi <dnmuturi@xxxxxxxxx> wrote:
>>
>>> Hi Team,
>>> I have a data element set us Average sum in org unit hierarchy and
>>> collected on a bi weekly basis, when I select the data in the pivot table,
>>> the average values are bizarre(see attachment). Is this how the above
>>> aggregation operator is meant to work or its a bug?
>>> rgds
>>> David
>>>
>>> _______________________________________________
>>> 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/>
>>
>>
>
--
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
lars@xxxxxxxxx
http://www.dhis2.org <https://www.dhis2.org/>
References