I need some thoughts and logic on the follwoing requirement.
I have a set of data by date , week, period and amount
each weeks amount is added to next week till the end of the week of a particular month. My requirement is to write the amounts per each week by subtracting the amount from previous week amount .
Here is the sample data
Code: Select all
CSTNBR,RPT_DT,MTH_ID,WK_ID,AMT
1111111,2006-01-01,1,1,100
1111111,2006-01-08,1,2,300
1111111,2006-01-15,1,3,550
1111111,2006-01-22,1,4,850
1111111,2006-01-29,1,5,1000
Code: Select all
CSTNBR,RPT_DT,MTH_ID,WK_ID,AMT
1111111,2006-01-01,1,1,100
1111111,2006-01-08,1,2,200
1111111,2006-01-15,1,3,250
1111111,2006-01-22,1,4,300
1111111,2006-01-29,1,5,150