# Manage Nulls in KPIs

Hello Everyone,
We have some KPIs which are the result of a Criteria over the population. I.e cases that follows directly from process A -> B DIVIDED all the cases that went through A

There are cases where the numerator and denominator are Zero , Celonis manage 0/0 as NULL which is correct, but for my KPI I should present either 0% or ‘No Activities’ instead of “-”

Can you please advice the effective way to manipulate the output of the KPI to manage the Nulls?

Regards,

Example:
SUM(
CASE WHEN “BKPF”.“AWTYP” IN (‘BKPF’, ‘BKPFF’, ‘BKPFI’, ‘IBKPF’, ‘TRAVL’)
AND “BSEG”.“BSCHL” = ‘31’
AND PROCESS EQUALS ‘Invoice posted’ TO ‘Pay Invoice’
THEN “BSEG”.“WRBTR_CONVERTED”
ELSE
0.0
END)

/

SUM ( CASE WHEN MATCH_ACTIVITIES(ENDING[‘Pay Invoice’] ) = 1
AND “BSEG”.“BSCHL” = ‘31’
AND “BKPF”.“AWTYP” IN (‘BKPF’, ‘BKPFF’, ‘BKPFI’, ‘IBKPF’, ‘TRAVL’)
THEN “BSEG”.“WRBTR_CONVERTED”
ELSE
0.0
END)

Hey Cristian,

Although I am a bit confused, on why you would want to present this KPI on Case Level since it is an aggregation that only makes sense on non-case level, you could just wrap around a is null.

CASE WHEN
ISNULL(your_example) = 1 THEN 0.0 ELSE your_example END

alternatively, you could check if your KPI is greater then 0:

CASE WHEN
your_example > 0.0 THEN your_example ELSE 0.0 END

Best Regards,

Benedict

Hi Bene, Thanks for your response
1- I was trying to find a way to avoid the evaluation of “your_example” twice, nevertheless this helps .
2- You are saying that this make sense on non-case level? I think its because my problem definition. I stated : " I.e cases that follows …." when the reality It should be “number of document items that follows”
If this is the case, you are right, if not can you please comment to clarify your statement.
Thanks!

Hi Cristian,

you can avoid having “your_example” twice by using COALESCE (available in IBC and CPM4.5):

``````COALESCE("your_example", 0.0)
``````

Best
David

2 Likes