← Back to team overview

dhis2-users team mailing list archive

Aggregation Query Builder: Syntax error?

 

Dear all,

i´m aggregating cases by diagnosis and gender. The query condition looks
like this:

*[CP:gender]='M' AND  ( [DE:2528.2529.2524]='210 - Dengue' OR
[DE:2528.2529.2524]='220 - Dengue grave' )
*
*
*
*[CP:gender]='F' AND  ( [DE:2528.2529.2524]='210 - Dengue' OR
[DE:2528.2529.2524]='220 - Dengue grave' ) *

When I check the results, I get more cases that what I really have in the
DB. I´ve seen, in this example, "Dengue Grave" cases are counted  twice,
one in M cases and one in F cases, while "Dengue" cases are working fine.

The only way that result makes sense is thinking that the bracket is not
being taken into account and the condition is being executed like this
  *[CP:gender]='F'
AND  [DE:2528.2529.2524]='210 - Dengue' OR [DE:2528.2529.2524]='220 -
Dengue grave' *

After swapping the "Dengue"and "Dengue Grave" position inside the bracket,
result changes, getting duplicated the "Dengue"cases now, which supports
the idea of the bracket not setting priorities over the logic operators.

Is this possible??? It would explain a lot of weird numbers I´m getting
while aggregating :)

Thanks!

Follow ups