Skip to main content

I would like to create a KPI to count the cases of the previous month do a dropdown but I keep getting a message that "The aggregation function MAX cannot be used together with a dimension function input. Please check that there are no aggregations and dimensions used together as function inputs.” .Have you got idea how to do it?

MY pql: 

COUNT( DISTINCT CASE WHEN ROUND_MONTH("EKKO"."AEDAT") = MAX(ROUND_MONTH("EKKO"."AEDAT"))

THEN "EKKO"."MANDT"

END

)

You cannot use a MAX function inside a COUNT, aggregation will not work with dimension function.

Try this instead 

 

COUNT( DISTINCT CASE WHEN ROUND_MONTH("EKKO"."AEDAT") = PU_MAX(DOMAIN_TABLE("EKKO"."EBELN"),ROUND_MONTH("EKKO"."AEDAT"))

THEN "EKKO"."MANDT"

END

)


You cannot use a MAX function inside a COUNT, aggregation will not work with dimension function.

Try this instead 

 

COUNT( DISTINCT CASE WHEN ROUND_MONTH("EKKO"."AEDAT") = PU_MAX(DOMAIN_TABLE("EKKO"."EBELN"),ROUND_MONTH("EKKO"."AEDAT"))

THEN "EKKO"."MANDT"

END

)

Thanks for your help,

This PQL below resolved my case:

COUNT(DISTINCT 
CASE WHEN ROUND_MONTH("EKKO"."AEDAT") = PU_MAX(CONSTANT(), FILTER_TO_NULL (ROUND_MONTH("EKKO"."AEDAT"))
THEN "EKKO"."MANDT" END )


Reply