Hello all,
I would like to compare how certain attributes of selected cases compare to the overall share of cases with that attribute.
For example:
All cases have a certain color. I would like to know what is the share of each color for my selected cases compared to the share of that color for all cases.
The result should look like (simplified):
Color | Selected Cases | All Cases | Difference
red | 15% | 30% | -15%
green| 85% | 70% | 15%
Therefore I created a OLAP table with the dimension "color" and the following KPIs:
The KPI for my selected cases is:
(COUNT ( DISTINCT "table"."case_id" ) / GLOBAL(COUNT ( DISTINCT "table"."case_id" )))
-> works fine
For all cases the KPI is:
PU_COUNT_DISTINCT (DOMAIN_TABLE ("table"."color"), "table"."case_id") /
PU_COUNT_DISTINCT ( CONSTANT(), "table"."case_id")
-> which also works fine
But when trying to substract both values from each other (KPI1 - KPI2) to create the difference, the following error occurs:
The aggregation function COUNT cannot be used together with a dimension function input. Please check that there are no aggregations and dimensions used together as function inputs.
How can I calculate the difference between these two values?
Many thanks,
Marcus