Hi Stefan,
I assume that the total count is larger than the sum of the single counted values? This is due to cases which contain both Activities 400-ABC
and 400-EBC
. Such a case is not counted in the first single counted KPI (because the PU_COUNT of â400-EBCâ is not 0), and it is not counted in the second single counted KPI (because the PU_COUNT of â400-ABCâ is not 0).
However, this case is counted in the total KPI, because the condition âACTIVITIESâ.âACTIVITYâ =â400-ABCâ OR âACTIVITIESâ.âACTIVITYâ =â400-EBCâ
evaluates to true.
In order to define the single counted KPIs correctly, you should use the PU_LAST logic again to determine which activity should be counted for the case:
Single Counted KPI 1:
COUNT ( CASE WHEN PU_LAST("CASES"."ACTIVITIES"."ACTIVITIES",
"ACTIVITIES"."ACTIVITY" IN ('400-ABC', '400-EBC')) = '400-ABC' THEN 1 ELSE NULL END )
Single Counted KPI 2:
COUNT ( CASE WHEN PU_LAST("CASES"."ACTIVITIES"."ACTIVITIES",
"ACTIVITIES"."ACTIVITY" IN ('400-ABC', '400-EBC')) = '400-EBC' THEN 1 ELSE NULL END )
The overall count should still just be
COUNT("Cases")
Additionally, you should filter out all cases which do not contain any of those two activities:
FILTER PROCESS EQUALS ('400-ABC', '400-EBC');
Best
David