Hello there,
I need some help on updating SQL table, where there is 0 values in the row update it with the last non null values from the rows.
| Loan ID | Date | Credit Limit |
| 1 | 2008-01-31 00:00:00.000 | 200 |
| 1 | 2008-02-29 00:00:00.000 | 0 |
| 1 | 2008-03-31 00:00:00.000 | 300 |
| 1 | 2008-04-30 00:00:00.000 | 300 |
| 1 | 2008-05-31 00:00:00.000 | 0 |
| 1 | 2008-06-30 00:00:00.000 | 400 |
| 1 | 2008-07-31 00:00:00.000 | 0 |
Expected results:
| Loan ID | Date | Credit Limit |
| 1 | 2008-01-31 00:00:00.000 | 200 |
| 1 | 2008-02-29 00:00:00.000 | 200 |
| 1 | 2008-03-31 00:00:00.000 | 300 |
| 1 | 2008-04-30 00:00:00.000 | 300 |
| 1 | 2008-05-31 00:00:00.000 | 300 |
| 1 | 2008-06-30 00:00:00.000 | 400 |
| 1 | 2008-07-31 00:00:00.000 | 400 |
I have tried multi row formula like below, but it doesn't work:
IF ISNull([CreditLimit]) then [Row-1:CreditLimit]
ELSE [CreditLimit]
ENDIF
Can someone please help?
Thank you for your time!