← Back to team overview

dhis2-users team mailing list archive

Re: Aggregation by latest period

 

Hi,

I think this would be beneficial not only for event data but also for
aggregate data. One of the data aggregation requirements frequently
forwarded is the last period's value of a given data element.

For instance, there is a data element named "*Number of HIV patients
currently on ART*", which is collected Monthly. This data element is aimed
to show how many people are currently on ART treatment which can later be
used for intervention and resource allocation purposes.

While we are retrieving an aggregate of the last 12 months for this
specific data element, it should pull the last period's data for this data
element. Currently none of the aggregation operators support this. The
Average (sum in orguinit hierarchy), Minimum and Maximum are closer but
none of them are satisfactory since the number of patients who are
currently on ART may increase or decrease in the specified time span.

My suggestion is if we have an aggregation operator which just pulls the
last period's data (for period dimension) and sum (for orgunit dimension).

Seid,

On Mon, Jun 12, 2017 at 8:32 AM, Andrei Evguenov <andrei@xxxxxxxxxx> wrote:

> Hi,
>
> Is there any way in analytic api to select latest data value for
> aggregation ? As per example:
>
> orgUnitParent -> child1,child2
> dataElement [number] de1
> dataSet [monthly] -> de1
>
> dataValue: de1 -> child1 -> 2017-03-01 -> value = 10
> dataValue: de1 -> child2 -> 2017-03-01 -> value = 4
>
> At this stage analytic api call for orgUnitParent, dx:de1 ou:orgUnitParent
> pe:THIS_YEAR ->   "rows": [ [ “de1”, "2017”, “orgUnitParent”, “14" ] ], 14
> is good but lets POST another value:
>
> dataValue: de1 -> child2 -> 2017-05-01 -> value = 6
>
> Now analytic api call for orgUnitParent, dx:de1 ou:orgUnitParent
> pe:THIS_YEAR ->   "rows": [ [ “de1”, "2017”, “orgUnitParent”, “20" ] ], 20
> .. sums all data values… we need just sum of the latest values, i.e 16
>
> I have read: https://lists.launchpad.net/dhis2-users/msg13042.html it’s
> programs/event setup, and the answer didn’t seem to help me.  Reading the
> documentation I assume there is not LATEST relative period, and currently
> we have to do the following to get the desired result:
>
> orgUnitGroup -> child1, child2
>
> Analytic api call dx:de1 ou:OU_GROUP:orgUnitGroup
> pe:THIS_MONTH;LAST_12_MONTH -> "rows": [[ “de1”, "201703”, “child1”, “10”
> ],  [ “de1”, "201703”, “child2”, “4” ], [ “de1”, "201705”, “child2”, “6” ]]
> -> after that our server in between front end and dhis2 instance does the
> aggregation manual based on latest value for OU..
>
> It would be awesome if there was another option since we are using DHIS2
> because of it’s aggregation capabilities.
>
> Appreciate your helpful response,
>
> Andrei @ Sussol
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References