Consumer Lending Analyst Path · Mission 16 of 30Hard

Early-Payment Default rate by vintage month

Multi-CTE with ROW_NUMBER + HAVING to define a seasoned cohort, then conditional ratio across vintages

The Brief

Marcus HollandChief Credit Officerconsumer-lending

Vintage signal for the credit committee. Compute Early-Payment Default rate by `funded_date` month — a loan is EPD if any of its first 3 scheduled payments came in `late` or `missed`. Only count loans that have all 3 payments due (so the youngest vintages don't poison the rate). Four columns: `vintage_month`, `seasoned_originations` (count of loans with 3+ payments due), `epd_count`, `epd_rate` (4 decimals). Filter `funded_date >= '2024-11-01'` to skip the 2019 ARM cohort. Sort by vintage_month ascending.

You'll practice

Multi-CTEROW_NUMBERCohort seasoning

Tables & columns available

lending_originationsfact17 columns
ColumnTypeKey
origination_idINTPK
app_idINTFK → lending_applications
account_idINTFK → retail_accounts
funded_dateTEXT
funded_amountREAL
term_monthsINT
interest_rateREAL
rate_typeTEXT
arm_reset_dateTEXT
fico_at_origINT
dti_at_origREAL
ltv_at_origREAL
property_valueREAL
lo_nameTEXT
channelTEXT
current_statusTEXT
closed_dateTEXT
lending_paymentsfact10 columns
ColumnTypeKey
payment_idINTPK
origination_idINTFK → lending_originations
due_dateTEXT
paid_dateTEXT
scheduled_amountREAL
principal_paidREAL
interest_paidREAL
escrow_paidREAL
days_lateINT
statusTEXT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

EPD is defined on each loan's first 3 scheduled payments — so the first job is identifying which payments those are, per loan. Reach for a window function that ranks payments by due_date partitioned per origination.

Hint 2

Two CTE-style steps compose the cohort: keep only the rank ≤ 3 rows, then gate the population to loans that have all 3 payments due using HAVING on the count. That HAVING is what enforces "seasoned" — youngest vintages with fewer than 3 payments due drop out so they don't poison the rate.

Hint 3

Per-loan EPD flag: any of the first 3 was bad → flagged. The bad-status set is what the briefing calls late or missed. Outer SELECT joins the cohort back to originations for the vintage label (DATE_TRUNC + TO_CHAR), then the conditional ratio computes EPD rate per month.