Hi Mohd,
It worked Perfect for the new balance field, thank you so much, Also the balance field should change
In the above result set the 3rd Week balance should be same as 2nd week new balance
In other words, 2nd Week Balance should be same as first week new balance as shown below
Input
SSN | DATE | BALANCE | PAID_AMOUNT |
111111111 | 1ST Week | 1000 | 100 |
111111111 | 2nd Week | 1000 | 100 |
111111111 | 3rd Week | 1000 | 100 |
111111112 | 1ST Week | 1000 | 100 |
111111112 | 2nd Week | 1000 | 100 |
111111112 | 3rd Week | 1000 | 100 |
111111112 | 4TH Week | 1000 | 100 |
output
SSN | DATE | BALANCE | NEW_BALANCE |
111111111 | 1ST Week | 1000 | 1000 |
111111111 | 2nd Week | 1000 | 900 |
111111111 | 3rd Week | 1000 | 800 |
111111112 | 1ST Week | 1000 | 1000 |
111111112 | 2nd Week | 1000 | 900 |
111111112 | 3rd Week | 1000 | 800 |
111111112 | 4TH Week | 1000 | 700 |
Thanks for your Effort