SUM IF Funktionality

Dear All I am looking for a solution to calculate a KPI based on a condition
I tried it with this statement but there is an error

CASE WHEN “EKBE”.“VGABE” LIKE ‘2’ THEN SUM(“EKBE”.“WRBTR”) ELSE 0 END)

image

Hi Marco,

you need to put the CASE WHEN inside the aggregation function:

SUM ( CASE WHEN "EKBE"."VGABE" LIKE '2' THEN "EKBE"."WRBTR" ELSE NULL END )

Cheers
David