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

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

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@gmail.com 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

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)

image

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@gmail.com 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…


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, May 9, 2016 at 1:49 PM, Greg Rowles greg.rowles@gmail.com 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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Hi Greg,

no - not possible at the moment, sorry. You will have to do the final calculation client-side.

regards,

Lars

image

···

On Mon, May 9, 2016 at 2:13 PM, Jason Pickering jason.p.pickering@gmail.com 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


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, May 9, 2016 at 2:02 PM, Greg Rowles greg.rowles@gmail.com 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…


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Mon, May 9, 2016 at 1:49 PM, Greg Rowles greg.rowles@gmail.com 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

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

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

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

I would expect from this

image

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

image

···

On Mon, May 9, 2016 at 8:53 PM, Lars Helge Øverland lars@dhis2.org 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@gmail.com 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


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

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@dhis2.org

http://www.dhis2.org

On Mon, May 9, 2016 at 2:02 PM, Greg Rowles greg.rowles@gmail.com 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…


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On Mon, May 9, 2016 at 1:49 PM, Greg Rowles greg.rowles@gmail.com 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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049