MSUM/CSUM/RECURSIVE What to use to get result :S

General
Enthusiast

MSUM/CSUM/RECURSIVE What to use to get result :S

Hey TD Geniuses ,

Please help me getting below result .







month_given column_given expense_given sum_expected
1 A 10 0
1 A 20 10
1 A 30 30
2 A 10 60
2 A 20 70
2 A 30 80
2 A 10 90
3 A 20 100
3 A 30 120
3 A 10 150

In 4th line , when month changes 60 comes from summing all expenses of  last month then cumulative sum follows for same month.

Thanks in advance .

1 REPLY
Enthusiast

Re: MSUM/CSUM/RECURSIVE What to use to get result :S

Hey TD Geniuses ,

Please help me getting below result .

month_given    column_given    expense_given    sum_expected

1    A    10    0

1    A    20    10

1    A    30    30

2    A    10    60

2    A    20    70

2    A    30    90

2    A    10    120

3    A    20    70

3    A    30    90

3    A    10    120

4    A    10    60

In 4th line , when month changes 60 comes from summing all expenses of  last month then cumulative sum follows for same month.

Thanks in advance .