Skip to main content
Question

How to subtract the running total from a target quantity? Dimension error.

  • December 13, 2022
  • 3 replies
  • 13 views

Hi,

 

I wanted to implement the open target quantity in celonis. Therefore I used the RUNNING_TOTAL function to add up the quantities as shown in the screenshot.

After, I wanted to subtract the RUNNING_TOTAL from the target quantity, the code for this looks like that:

 

"CONTRACT_INFO"."KTMNG" - RUNNING_TOTAL("EKPO"."MENGE")

 

That constantly gives me the following error:

 

The running aggregation function RUNNING_TOTAL cannot be used together with a dimension function input. Please check that there are no moving aggregations and dimensions used together as function inputs.

 

Even if I try to use e.g. AVG(), SUM(), LAST() in front of "CONTRACT_INFO"."KTMNG" , it's not working.

Only if I use RUNNING_TOTAL() in front of "CONTRACT_INFO"."KTMNG" it's working, but obviously this is giving me wrong results.

 

Thanks for your help.

3 replies

milan.eric
Level 6
Forum|alt.badge.img
  • Level 6
  • May 13, 2024

@niklas.meder hey, it has been a while but did you manage to find a solution back then? I am currently sitting at the same problem...

 


Forum|alt.badge.img+3

@niklas.meder hey, it has been a while but did you manage to find a solution back then? I am currently sitting at the same problem...

 

hello, did you find a solution? @milan.eric @niklas.meder 


milan.eric
Level 6
Forum|alt.badge.img
  • Level 6
  • June 12, 2024

hello, did you find a solution? @milan.eric @niklas.meder 

Hey @paula.brici ,

I was not able to do it with RUNNING_TOTAL. I was able to achieve my goal with a RUNNING_SUM instead by using their Order by and partition by functions to filter and align it the way I needed it.:

 

RUNNING_SUM ( FILTER_TO_NULL ( "EKEH"."MENGE"-"EKEH"."WEMNG"), ORDER BY ("EKEH"."EINDT" ASC), PARTITION BY ("EKEK"."EBELN") )

+

"EKEK"."ABEFZ"

 

This might not work for your case but maybe it helps somehow.