Skip to main content
Solved

Cumulative Sum Question

  • February 27, 2026
  • 3 replies
  • 43 views

Forum|alt.badge.img

I want to calculate cumulative sum for column ‘Net Weight’ by Year . Below picture is result i want to have.

Column definition:

  1. ‘SO Created Year’ = ROUND_YEAR("VBAK"."ERDAT")
  2. ‘Created Month’ = ROUND_MONTH("VBAK"."ERDAT")
  3. ‘Net Weight’ =  KPI(“so_netweight”)

 

  1. Cumulative Sum=

         if I use formula : RUNNING_SUM(kpi("so_netweight"),order by("vbak"."so_creatd_year"), partition by("vbak"."created_month_so_"))  , i got below error.
 

 

can anyone help ?

Best answer by fabian.wende

thanks ​@fabian.wende .

But it does not group by ‘Created Month (SO)’ . It still give me the detail list. can help you ?

 

Yes I can help - I forgot to mention that you have to Aggregate the running_sum again:
This should be working fine:
SUM(RUNNING_SUM(*****))

3 replies

fabian.wende
Level 6
Forum|alt.badge.img+1

You can’t use RUNNING_SUM on an SUM aggregate which then should be grouped in another way. Just use your RUNNING_SUM this way:

RUNNING_SUM(

"VBAK"."NETWR",

order by("vbak"."created_month_so_"),

partition by("vbak"."so_creatd_year")

)

 

(Additionally you switched order by and partition by, which I fixed)

 

Best regards,

Fabian


Forum|alt.badge.img
  • Author
  • Level 8
  • March 5, 2026

thanks ​@fabian.wende .

But it does not group by ‘Created Month (SO)’ . It still give me the detail list. can help you ?

 


fabian.wende
Level 6
Forum|alt.badge.img+1
  • Level 6
  • Answer
  • March 5, 2026

thanks ​@fabian.wende .

But it does not group by ‘Created Month (SO)’ . It still give me the detail list. can help you ?

 

Yes I can help - I forgot to mention that you have to Aggregate the running_sum again:
This should be working fine:
SUM(RUNNING_SUM(*****))