Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
buttonmaker
Contributor
Contributor

how to summarize the monthly turnover

 

Hi all,
seems, that I have a quite common case here, but I  have not found a solution here yet:
I have a table of sales per year and month

I'm looking for a solution to count the numbers in last column of below table

This column should summarize the monthly sales of the current year

I've tried this, but can't get the expected result:

sum(Aggr(Sum(WARENWERT), [BESTELDATUM.autoCalendar.YearMonth]))

yearmonthorderorder amountamount per monthcumulative in year

2021

Jan123250

500

500
2021Jan234300500500
2021Feb345200

600

1.100
2021Feb4564006001.100
2021MAR5671501501.250

 

Many thanks for your proposals

3 Replies
rubenmarin

Hi, with this script:

tmpData:
LOAD * Inline [
year,month,order,order amount
2021,Jan,123,250
2021,Jan,234,300
2021,Feb,345,200
2021,Feb,456,400
2021,MAR,567,150
]

This expression returns the values accumulated by month:

RangeSum(Above(TOTAL If(month=Above(TOTAL month),0,sum(TOTAL <month> [order amount])),0,RowNo(TOTAL)))
buttonmaker
Contributor
Contributor
Author

Hi many thanks. This will summarize the amounts over ALL years. Have an Ide, how to generate the sum per year?

 

 

rubenmarin

Hi, maybe this? : RangeSum(Above(TOTAL If(month=Above(TOTAL month),0,sum(TOTAL <year,month> [order amount])),0,RowNo(TOTAL)))