hi Rajesh,
I was on vacation for one week
i tried as per your above logic
for new_balance field upto 3 ranks i am getting correct but for rank 4 i am not getting as expected
i am using balance - PAID_AMOUNT * (RANK -1)
for example
Input
balance paid_amount rank ssn
1320 0 1 111111111
1320 17 2 111111111
1320 17 3 111111111
1320 4 4 111111111
Output
balance paid_amount rank ssn new_balance
1320 0 1 111111111 1320
1320 17 2 111111111 1303
1320 17 3 111111111 1286
1320 4 4 111111111 1308(should be 1284)
For the balance field, for rank 2 i am getting null
Using ifthenelse( RANK = 1, balance, previous_row_value(new_balance))
output getting as
balance paid_amount rank ssn new_balance
1320 0 1 111111111 1320
null 17 2 111111111 1303
1303 17 3 111111111 1286
1286 4 4 111111111 1308
any suggesion please
Thanks
Madhu