Average (sum in org unit hierarchy) not working in 2.24 and 2.25?

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

image

if a select the period as filter I suppose I should get 12 right? However, what I get is:

image

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

Sum accross org. unit tree seems to be ok

Thanks much

Jose

More info about this…

We only have data for October 2016 (20), and September 2016 (4). If I select periods as a filter, this is what happens:

  1. Last month. The value should be 20!!

image

  1. Last 3 months, last 6 months, and last 12 months, gives 24.7. It calculates the sum (with the strange 0.7), no the average.

  1. This Quarter (approx, the real result should be 6.666)

image

  1. Last Quarter (correct!)

image

  1. This six-month (approx, the result should be 4. Don’t understand why the addition of 0.1 as the results of divisions are integers)

image

  1. This year (correct!)

image

Will be great to have your feedback, as this is very urgent for us! :slight_smile: . It seems it works well (but with some rounding problems) when the periods selected in the analytics are quartes, six-months, years, etc. but no for months (that calculates the total).

Many thanks

Jose

image

image

···

On Tue, Nov 8, 2016 at 2:19 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

if a select the period as filter I suppose I should get 12 right? However, what I get is:

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

Sum accross org. unit tree seems to be ok

Thanks much

Jose

Hi devs,

any comments on this?

Thanks much!

Jose

image

image

image

image

image

image

image

···

On Fri, Nov 11, 2016 at 5:11 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

More info about this…

We only have data for October 2016 (20), and September 2016 (4). If I select periods as a filter, this is what happens:

  1. Last month. The value should be 20!!
  1. Last 3 months, last 6 months, and last 12 months, gives 24.7. It calculates the sum (with the strange 0.7), no the average.
  1. This Quarter (approx, the real result should be 6.666)
  1. Last Quarter (correct!)
  1. This six-month (approx, the result should be 4. Don’t understand why the addition of 0.1 as the results of divisions are integers)
  1. This year (correct!)

Will be great to have your feedback, as this is very urgent for us! :slight_smile: . It seems it works well (but with some rounding problems) when the periods selected in the analytics are quartes, six-months, years, etc. but no for months (that calculates the total).

Many thanks

Jose

On Tue, Nov 8, 2016 at 2:19 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

if a select the period as filter I suppose I should get 12 right? However, what I get is:

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

Sum accross org. unit tree seems to be ok

Thanks much

Jose

Hi Em,

You have been testing with average values recently. Do you have any idea?

image

image

image

image

image

image

image

···

On Wed, Nov 16, 2016 at 6:56 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi devs,

any comments on this?

Thanks much!

Jose


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 Fri, Nov 11, 2016 at 5:11 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

More info about this…

We only have data for October 2016 (20), and September 2016 (4). If I select periods as a filter, this is what happens:

  1. Last month. The value should be 20!!
  1. Last 3 months, last 6 months, and last 12 months, gives 24.7. It calculates the sum (with the strange 0.7), no the average.
  1. This Quarter (approx, the real result should be 6.666)
  1. Last Quarter (correct!)
  1. This six-month (approx, the result should be 4. Don’t understand why the addition of 0.1 as the results of divisions are integers)
  1. This year (correct!)

Will be great to have your feedback, as this is very urgent for us! :slight_smile: . It seems it works well (but with some rounding problems) when the periods selected in the analytics are quartes, six-months, years, etc. but no for months (that calculates the total).

Many thanks

Jose

On Tue, Nov 8, 2016 at 2:19 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

if a select the period as filter I suppose I should get 12 right? However, what I get is:

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

Sum accross org. unit tree seems to be ok

Thanks much

Jose

Hi Jose,

image

image

···

On Tue, Nov 8, 2016 at 2:19 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

if a select the period as filter I suppose I should get 12 right? However, what I get is:

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

This was a bug. Data elements with “sum + avg in hierarchy” aggregation operator were not handled properly when you had multiple periods as filter. Fixed now in 2.24 -> master.

best regards,

Lars

Sum accross org. unit tree seems to be ok

Thanks much

Jose


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

Hi Jose,

image

image

image

image

image

image

image

···

these issues should be fixed now (same problem as previous issue).

regards,

Lars

On Fri, Nov 11, 2016 at 5:11 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

More info about this…

We only have data for October 2016 (20), and September 2016 (4). If I select periods as a filter, this is what happens:

  1. Last month. The value should be 20!!
  1. Last 3 months, last 6 months, and last 12 months, gives 24.7. It calculates the sum (with the strange 0.7), no the average.
  1. This Quarter (approx, the real result should be 6.666)
  1. Last Quarter (correct!)
  1. This six-month (approx, the result should be 4. Don’t understand why the addition of 0.1 as the results of divisions are integers)
  1. This year (correct!)

Will be great to have your feedback, as this is very urgent for us! :slight_smile: . It seems it works well (but with some rounding problems) when the periods selected in the analytics are quartes, six-months, years, etc. but no for months (that calculates the total).

Many thanks

Jose


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 Tue, Nov 8, 2016 at 2:19 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

if a select the period as filter I suppose I should get 12 right? However, what I get is:

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

Sum accross org. unit tree seems to be ok

Thanks much

Jose

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Great news! Thanks Lars.

Would it be possible to also fix this for 2.25?

And about the rounding problems… is there any solution for that?

image

With periods as filters, we get 10.2 instead of 10…

image

Thanks Lars!

image

image

image

image

image

image

image

···

On Thu, Nov 17, 2016 at 4:49 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Jose,

these issues should be fixed now (same problem as previous issue).

regards,

Lars

On Fri, Nov 11, 2016 at 5:11 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

More info about this…

We only have data for October 2016 (20), and September 2016 (4). If I select periods as a filter, this is what happens:

  1. Last month. The value should be 20!!
  1. Last 3 months, last 6 months, and last 12 months, gives 24.7. It calculates the sum (with the strange 0.7), no the average.
  1. This Quarter (approx, the real result should be 6.666)
  1. Last Quarter (correct!)
  1. This six-month (approx, the result should be 4. Don’t understand why the addition of 0.1 as the results of divisions are integers)
  1. This year (correct!)

Will be great to have your feedback, as this is very urgent for us! :slight_smile: . It seems it works well (but with some rounding problems) when the periods selected in the analytics are quartes, six-months, years, etc. but no for months (that calculates the total).

Many thanks

Jose


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 Tue, Nov 8, 2016 at 2:19 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

if a select the period as filter I suppose I should get 12 right? However, what I get is:

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

Sum accross org. unit tree seems to be ok

Thanks much

Jose

Hi Jose,

image

image

image

image

image

image

image

image

image

···

On Sat, Nov 19, 2016 at 7:57 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Great news! Thanks Lars.

Would it be possible to also fix this for 2.25?

Yes it was fixed in 2.25 (when writing 2.24 -> master I mean starting from 2.24 including all versions up to master).

And about the rounding problems… is there any solution for that?

With periods as filters, we get 10.2 instead of 10…

This is (believe it or not) intentional per now. The reason is that when calculating average scores we weigh data values by the number of days in their periods. So in this case we get:

((20×31)+(0×30)) ÷ 61 = 10,1639 ~~ 10,2

This because October has 31 days, September has 30 days (total 61). This looks a bit strange but is correct according to the way the system calculates averages (the null value discussion aside).

We need to weigh values by days. As an example, when asking for a yearly average, there might be data which is both monthly and quarterly - a quarterly data should impact the average more than a monthly data etc. So this looks a bit strange with the monthly values but is a product of different days in months.

Lars

Thanks Lars!

On Thu, Nov 17, 2016 at 4:49 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Jose,

these issues should be fixed now (same problem as previous issue).

regards,

Lars

On Fri, Nov 11, 2016 at 5:11 AM, Jose Garcia Muñoz josemp10@gmail.com wrote:

More info about this…

We only have data for October 2016 (20), and September 2016 (4). If I select periods as a filter, this is what happens:

  1. Last month. The value should be 20!!
  1. Last 3 months, last 6 months, and last 12 months, gives 24.7. It calculates the sum (with the strange 0.7), no the average.
  1. This Quarter (approx, the real result should be 6.666)
  1. Last Quarter (correct!)
  1. This six-month (approx, the result should be 4. Don’t understand why the addition of 0.1 as the results of divisions are integers)
  1. This year (correct!)

Will be great to have your feedback, as this is very urgent for us! :slight_smile: . It seems it works well (but with some rounding problems) when the periods selected in the analytics are quartes, six-months, years, etc. but no for months (that calculates the total).

Many thanks

Jose


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 Tue, Nov 8, 2016 at 2:19 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Dear devs,

I have the ‘test’ dataelement which its Agregation type is ‘Average (sum in org unit hierarchy)’, however it doesn’t seem to calculate the average for periods. For example

if a select the period as filter I suppose I should get 12 right? However, what I get is:

24.7 that I don’t understand. Am I doing something wrong? Is it a bug? This is very urgent for us. If it is a bug, we would need a fix for both, 2.24 and 2.25. Would that be possible?

Sum accross org. unit tree seems to be ok

Thanks much

Jose

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org