Aggregation of totals in data element report tables does not work

Bug #494408 reported by Ola Hodne Titlestad on 2009-12-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DHIS
High
Lars Helge Øverland

Bug Description

Report tables -> Data element report tables
(only affects data element with categorycombos not set to default)

For data element with categorycombos (dimensions) the aggregation of the total for the data element in data element report tables is not working. The total value for a data element does not match the sum of all the values for the "data element + catoptioncombo" combinations. It is from it in fact and seem to pick just a few of the catoptioncombos (and it is not 0 or NULL).

This does not affect the datamart because there all values are raw and include the catoptioncombo. If you do a manual group by data element there you can easily find the correct total.

You can all have a look at the online demo under report tables. I have created two tables to illustrate this problem:
1) Malaria morbidity total
2) Malaria morbidity by gender and age

Both tables are for the Sierra Leone orgunit, March 2009 and for the data element called Morbidity_Malaria.

If you click on the symbol for HTML, Excel or CSV export of the tables you can see that the total of Malaria cases in Sierra Leone according to table 1) is 835, and in table 2) you can see that the raw values (catoptioncombos) are much higher, and although the total is not listed here (subtotals and total are only seen in the database so far) a rough calculation I did ended up around 55000 cases of malaria, and clearly not 835.

I discovered this bug when I was working on a small test database I have so it does not seem to be related to the specific database of SL.
Could it be related to the newly introduced fix to hibernate mapping of catoptions and categories or something like that?

Changed in dhis2:
importance: Undecided → Critical
importance: Critical → Undecided
milestone: none → 2.0.3
importance: Undecided → High

This was caused by a missing SUM / GROUP BY clause in the statement that retrieved data for the report tables.

Changed in dhis2:
assignee: nobody → Lars Helge Øverland (larshelge)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers