Nested aggregate functions are not allowed
LucieneMay 6 2008 — edited May 7 2008I need a calculation that divides a parcial value (based on a condition) by the total. It is something like that:
CALCULATION 1:
PARCIAL_VALUE = CASE WHEN DURATION >= :PARAMETER THEN MEASURE_VALUE ELSE 0 END
CALCULATION 2:
DIVISION = CASE WHEN MEASURE_VALUE = 0 THEN 0 ELSE PARCIAL_VALUE / MEASURE_VALUE END
Calculation 1 only works if I use a SUM before the CASE. If I don't use the SUM, the calculation doesn't aggregate.
I believe I also should add a SUM before the CASE of Calculation 2, but I can't. I got the error: Nested aggregate functions are not allowed.
I tried to merge the two calculations, but I got the same error. I also tried to create a calculated item in detail level in the Administrator, but it didn't work too.
How can I reformulate this calculation in order to avoid this error?