← Back to team overview

dhis2-devs team mailing list archive

Re: WebAPI: Calculating indicator SUM/AVG for Quarters in a previous year

 

Hi Lars,

I have been thinking about this a bit more. Isn't this already possible
actually by specifying the two quarters and then using the period dimension
as a filter?

Like below:

https://play.dhis2.org/demo/api/analytics.json?dimension=dx:fbfJHSPpUQD;Uvn6LCg7dVU&dimension=ou:ImspTQPwCqd&filter=pe:2015Q2;2015Q3&displayProperty=NAME&skipMeta=true

[image: Inline image 1]

The ANC1 data element does what its supposed to I think, but the indicator
does not.

I would expect from this
[image: Inline image 2]

That we would get 138,518/((487,902/2)/12*6)=113.6%,

The population should be averaged and then annualized, while the numerator
should be summed.

Is this a bug then? It seems like something which should be supported
actually, as it is a fairly common use case to be able to filter over the
last X number of weeks, days, or months and calculate a coverage rate.

Regards,
Jason



On Mon, May 9, 2016 at 8:53 PM, Lars Helge Øverland <lars@xxxxxxxxx> wrote:

> Hi Greg,
>
> no - not possible at the moment, sorry. You will have to do the final
> calculation client-side.
>
> regards,
>
> Lars
>
>
> On Mon, May 9, 2016 at 2:13 PM, Jason Pickering <
> jason.p.pickering@xxxxxxxxx> wrote:
>
>> Hi Greg,
>> I do not think this particular period exists.
>>
>> You have six-monthly periods, but they are defined as Jan-Jun (Q1 + Q2)
>>  and July-December (Q3 + Q4)
>>
>>
>> which is not what you want.
>>
>> I do not think this is currently possible.
>>
>> Regards,
>> Jason
>>
>>
>>
>> ​
>>
>> On Mon, May 9, 2016 at 2:02 PM, Greg Rowles <greg.rowles@xxxxxxxxx>
>> wrote:
>>
>>> Sorry, I should have been clearer. I mean to collapse the period
>>> dimension and calculate the average or sum depending on the indicator
>>> type...
>>>
>>> On Mon, May 9, 2016 at 1:49 PM, Greg Rowles <greg.rowles@xxxxxxxxx>
>>> wrote:
>>>
>>>> Dear Devs
>>>>
>>>> Is there a way to call the analytics API so that it calculates an
>>>> indicator value for 2 quarters in a previous year? E.g. I want the average
>>>> indicator score for an indicator but from Q2 + Q3 of 2015 and not the
>>>> individual quarterly values but the combined average for that period
>>>> range...
>>>>
>>>> Kind Regards,
>>>> Greg
>>>>
>>>> --
>>>> *Health Information Systems Program - South Africa*
>>>> *- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - -
>>>> - - *
>>>> Mobile  :    073 246 2992
>>>> Landline:   021 851 2216
>>>> Skype:      gregory_rowles
>>>>
>>>
>>>
>>>
>>> --
>>> *Health Information Systems Program - South Africa*
>>> *- - - - - - - **- - - - - - - **- - - - - - - **- - - - - - - **- - -
>>> - - *
>>> Mobile  :    073 246 2992
>>> Landline:   021 851 2216
>>> Skype:      gregory_rowles
>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>>
>> --
>> Jason P. Pickering
>> email: jason.p.pickering@xxxxxxxxx
>> tel:+46764147049
>>
>> _______________________________________________
>> 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/>
>
>


-- 
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049

PNG image

PNG image

PNG image


References