Days Past Due

New schema DPD calculation

To calculate DPD, you need to go through two steps.
1. If the transactions.end_balance < (sum(disbursements.total_amount) x (1 - dpd_writeoff) then DPD is set to zero on that date (the loan is considered paid off / written off / recovered). Usually if the end balance is less than 1% of the total disbursements up to that date, the loan is considered paid off and so 0 DPD.
2. If running_due > running_paid, then the date where that is true is the dpd_date that DPD should be calculated from.

Original schema DPD calculation

On each month-end, this loan has the following next_unpaid_dates:
Datenext_unpaid_datedpd
31/05/21 18/06/210
30/06/2118/07/210
30/07/21 18/07/2112
31/08/2118/08/2113
30/09/21NULL (loan finished)NULL (loan finished)

For a given date, d:

dpd = max(0,next_unpaid_date − d)

Days past due cannot be negative. A loan that is 0 DPD is considered current, anything else is considered late.