Skip to main content

Dear Colleagues,

I am using below formula to calculate AVG processing time per vendor.

It works generally OK, but it always calculates an average from the whole available set of data. For example if we have 3 years history of invoice posting and I only want to see an average for year 2020, applying time selection filter does not change the result of this formula, which keeps calculation for 2018-2020. Is there any way to keep this AVG dynamic and alligned with current selections?

Thank you.

PU_AVG(DOMAIN_TABLE(LFA1.NAME1||LFA1.SOURCESYSTEM),

CASE

WHEN MATCH_ACTIVITIES(NODE[WF step: Remove Qty block] )=1

THEN CALC_THROUGHPUT(FIRST_OCCURRENCE[Invoice posted] TO LAST_OCCURRENCE[WF step: Remove Qty block],

REMAP_TIMESTAMPS("_CEL_AP_ACTIVITIES".EVENTTIME, DAYS))

ELSE CALC_THROUGHPUT(FIRST_OCCURRENCE[Invoice posted] TO LAST_OCCURRENCE[WF step: Price difference approval],

REMAP_TIMESTAMPS("_CEL_AP_ACTIVITIES".EVENTTIME, DAYS))

END

)

@krzysztof.sitar11 

Have you tried the PU_AVG function? With this function you can also apply filters in the third argument which allows you AVG to be calculated correctly.

 

Best,

Kevin


Hi Krzyztof,

You almost got it right. Please refer to the following example using FILTER_TO_NULL. The first example on the link below does exactly what you are looking for (making PU functions filter-aware).

celonis.cloud/help/display/CIBC/FILTER_TO_NULL

Best,

Gabriel


Reply