Skip to main content

Hi team,

 

I want to create a KPI to measure the proportion of items with missing routes. BUT I want the scope of my data to be filtered only on specific order types.

I could add a filter on the component, but to make sure the KPI is always measured the same everywhere, I want to have the filter within the KPI calculation.

 

I understand the below formula is not correct ('The aggregation function SUM cannot be used together with a dimension function input.') but I am struggling to find the solution. Any suggestion ?

 

Thanks heaps

 

CASE WHEN "VBAK"."AUART" IN ('ZCS','ZECH','ZEDI','ZCSG','ZEDC')

THEN SUM (CASE WHEN "VBAP"."ROUTE" IS NULL THEN 1 ELSE NULL END)

/ COUNT_TABLE ( "VBAP" )

ELSE NULL END

Hi Lovise,

 

please try it like this:

 

SUM(CASE WHEN "VBAK"."AUART" IN ('ZCS','ZECH','ZEDI','ZCSG','ZEDC') AND ISNULL("VBAP"."ROUTE") = 1 THEN 1.0 ELSE 0.0 END)

/ COUNT_TABLE ( "VBAP" )

 

BR

Dennis


thanks for taking the time to respond @dennis.pflug 

the formula technically works but it does not match what I want to achieve.

my filter should apply to the entire formula (the dividend and the divisor).

In other words:

number of items when route is null and so type = A, B, C

/

number of items when so type = A, B, C

 

cheers


Ok than something like this?

 

SUM(CASE WHEN "VBAK"."AUART" IN ('ZCS','ZECH','ZEDI','ZCSG','ZEDC') AND ISNULL("VBAP"."ROUTE") = 1 THEN 1.0 ELSE 0.0 END)

/

SUM(CASE WHEN "VBAK"."AUART" IN ('ZCS','ZECH','ZEDI','ZCSG','ZEDC') THEN 1.0 ELSE 0.0 END)

 

 


Ok than something like this?

 

SUM(CASE WHEN "VBAK"."AUART" IN ('ZCS','ZECH','ZEDI','ZCSG','ZEDC') AND ISNULL("VBAP"."ROUTE") = 1 THEN 1.0 ELSE 0.0 END)

/

SUM(CASE WHEN "VBAK"."AUART" IN ('ZCS','ZECH','ZEDI','ZCSG','ZEDC') THEN 1.0 ELSE 0.0 END)

 

 

yes ! it works !!

thank you @dennis.pflug 


Reply