Consumer Lending Analyst Path · Mission 13 of 30Medium

DTI bucket pivot for originations

CASE bucketing across credit-policy thresholds + window-function share-of-total

The Brief

Marcus HollandChief Credit Officerconsumer-lending

Underwriting policy review next week. Bucket every funded origination by `dti_at_orig` into four bands and report the share. Bands: `0.20-0.29`, `0.30-0.36`, `0.37-0.43`, `>0.43`. The 0.43 line is the QM-rule threshold — anything above is non-QM and books differently. Three columns: `dti_band`, `loan_count`, `pct_of_book` (4 decimals). Sort by `dti_band` ascending.

You'll practice

CASE bucketsWindow share-of-total

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

Hints (3)

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

Hint 1

CASE bucket on `dti_at_orig`. Reuse the prefixed-label trick from M11 to control lex-sort. Mind the boundary on the QM cutoff: the briefing wants 0.43 inclusive on the QM-side band and strictly above on the non-QM band — that boundary convention is what audit will check.

Hint 2

Single-table query — `dti_at_orig` is on the originations row, no JOIN needed. (The concept tag mislabels this as a JOIN task — ignore it.)

Hint 3

For pct_of_book, same aggregate window function pattern as M12 — count divided by the grand total computed over the un-partitioned window. Round to 4 decimals.