Skip to main content

Hello everyone,

 

I'm trying to count the number of materials per purchasing group that have been active in e.g. the year of 2023:

 

PU_COUNT_DISTINCT("T024", BIND ("_CEL_P2P_ACTIVITIES", "MARC"."MATNR"),

"_CEL_P2P_ACTIVITIES"."ACTIVITY_EN"='Create Purchase Order Item' AND

YEAR("_CEL_P2P_ACTIVITIES"."EVENTTIME")=2023))

 

I want the aggregation to be made per purchasing group (T024). MARC provides the information which purchasing group is responsible for each material number. I need _CEL_P2P_ACTIVITIES table to filter the eventtime within my view. This aggregation works, however, when wanting to build an average (per purchasing group) like this, it does not work - error: "The aggregation function COUNT cannot be used together with a dimension function input. Please check that there are no aggregations and dimensions used together as function inputs":

 

PU_COUNT_DISTINCT("T024", BIND ("_CEL_P2P_ACTIVITIES", "MARC"."MATNR"),

"_CEL_P2P_ACTIVITIES"."ACTIVITY_EN"='Create Purchase Order Item' AND

YEAR("_CEL_P2P_ACTIVITIES"."EVENTTIME")=2023))

 

/ COUNT(DISTINCT "EKKO"."EKGRP" (distinct purchasing groups that were actively purchasing)

 

Also what I have noticed is that the KPI only will be filtered when incorporating the 'AND

YEAR("_CEL_P2P_ACTIVITIES"."EVENTTIME")=2023)' within the KPI. If not and filtering for the year 2023 within the view the number does not change.

 

Does anyone have experience on this?

 

Thank you so much!

 

Best regards

Julia Bauer

Hi @julia.bauer,

 

Regarding the question with the filter on PU_functions: It is indeed the case that Pull-Up-functions ignore the global filter state and are calculated only once. This is why you need to specify a filter expression in PU_functions itself as you did correctly.

 

I sadly don't have much experience in this use case, but I think the CONSTANT function can help you out here. You can aggregate a value from a source column (like "EGKRP" here) into a single value. It can then be used as target table inside a PU_Function.

 

https://docs.celonis.com/en/constant.html

 

Hopefully this puts you in the right track 😊

 

Kind regards,

Sverre Klein


Hi @julia.bauer,

 

Regarding the question with the filter on PU_functions: It is indeed the case that Pull-Up-functions ignore the global filter state and are calculated only once. This is why you need to specify a filter expression in PU_functions itself as you did correctly.

 

I sadly don't have much experience in this use case, but I think the CONSTANT function can help you out here. You can aggregate a value from a source column (like "EGKRP" here) into a single value. It can then be used as target table inside a PU_Function.

 

https://docs.celonis.com/en/constant.html

 

Hopefully this puts you in the right track 😊

 

Kind regards,

Sverre Klein

Hello @sverre.klein11 ,

 

thank you for your help - it's very much appreciated 🙂 your confirmation that those filters only work when specified within the PU_function is a very good input as I firstly considered that my filters do not work correctly.

 

I will check the CONSTANT function!

 

Best regards

Julia Bauer


Hello @sverre.klein11 ,

 

thank you for your help - it's very much appreciated 🙂 your confirmation that those filters only work when specified within the PU_function is a very good input as I firstly considered that my filters do not work correctly.

 

I will check the CONSTANT function!

 

Best regards

Julia Bauer

HI,

you can use a FILTER_TO_NULL expression within your PU Function though, e.g. PU_COUNT(TABLE1, FILTER_TO_NULL(TABLE2.COLUMN)). Then all the filters that you set in your analysis are considered. However you cannot use a PU function with a filter_to_null for filtering.

BR

Stephanie


Hello @sverre.klein11 ,

 

thank you for your help - it's very much appreciated 🙂 your confirmation that those filters only work when specified within the PU_function is a very good input as I firstly considered that my filters do not work correctly.

 

I will check the CONSTANT function!

 

Best regards

Julia Bauer

Hello @stephanie.parra !

 

Thanks for your input.

 

Does this mean I won't have to insert the boldly marked statement for YEAR(EVENTTIME)=2023 when using the FILTER_TO_NULL expression?

 

PU_COUNT_DISTINCT("T024", BIND ("_CEL_P2P_ACTIVITIES", "MARC"."MATNR"),

"_CEL_P2P_ACTIVITIES"."ACTIVITY_EN"='Create Purchase Order Item' AND

YEAR("_CEL_P2P_ACTIVITIES"."EVENTTIME")=2023))

 

BR

Julia


Hello @sverre.klein11 ,

 

thank you for your help - it's very much appreciated 🙂 your confirmation that those filters only work when specified within the PU_function is a very good input as I firstly considered that my filters do not work correctly.

 

I will check the CONSTANT function!

 

Best regards

Julia Bauer

Yes, you could leave the bold part out. If you then filter within the analysis on the eventtime =2023, it will show you the result for 2023. With the filter_to_null it reacts on ALL filters!

BR

Stephanie


Hello @sverre.klein11 ,

 

thank you for your help - it's very much appreciated 🙂 your confirmation that those filters only work when specified within the PU_function is a very good input as I firstly considered that my filters do not work correctly.

 

I will check the CONSTANT function!

 

Best regards

Julia Bauer

Thank you Stephanie!

That was the function I was searching for :-)

 

BR

Julia


Reply