Hi everyone, i am trying to create cathegories for my pie chart. The categories would describe the Value of the "Case" based on payments (can be NULL) and the rest of the reserves 8also can be NULL) for the Case. I have started with the following description of the Categories:
(CASE WHEN
(
("CEL_SHUK_CASES"."ZAHLUNGEN" + "CEL_SHUK_CASES"."RESTRESERVEN")>=0 AND ("CEL_SHUK_CASES"."ZAHLUNGEN" + "CEL_SHUK_CASES"."RESTRESERVEN") <1000
OR
(("CEL_SHUK_CASES"."ZAHLUNGEN") IS NULL AND ("CEL_SHUK_CASES"."RESTRESERVEN")>=0 AND ("CEL_SHUK_CASES"."RESTRESERVEN")<1000)
OR
(("CEL_SHUK_CASES"."RESTRESERVEN") IS NULL AND ("CEL_SHUK_CASES"."ZAHLUNGEN")>=0 AND ("CEL_SHUK_CASES"."ZAHLUNGEN")<1000)
OR
(("CEL_SHUK_CASES"."RESTRESERVEN") IS NULL AND ("CEL_SHUK_CASES"."ZAHLUNGEN") IS NULL)
)
THEN '<1.000 €'
ELSE
(CASE WHEN
(
(("CEL_SHUK_CASES"."ZAHLUNGEN" + "CEL_SHUK_CASES"."RESTRESERVEN")>=1000 AND ("CEL_SHUK_CASES"."ZAHLUNGEN" + "CEL_SHUK_CASES"."RESTRESERVEN") <10000)
OR
(("CEL_SHUK_CASES"."ZAHLUNGEN") IS NULL AND ("CEL_SHUK_CASES"."RESTRESERVEN")>=1000 AND ("CEL_SHUK_CASES"."RESTRESERVEN")<10000)
OR
(("CEL_SHUK_CASES"."RESTRESERVEN") IS NULL AND ("CEL_SHUK_CASES"."ZAHLUNGEN")>=1000 AND ("CEL_SHUK_CASES"."ZAHLUNGEN")<10000)
)
THEN '<10.000 €'
ELSE
'BLABLA'
END)
END)
The problem i am facing is that i get a 4th cathegory "-" with all the combinations on NULLs that were not inclued into the category '<1000'.
My idea is that the values with NULLs that do not conform with the first "Case when" are thrown away and not used further. This is nonsece and i hope there is a way to fix ma pql.
TNX
Maria