Consumer Lending Analyst Path · Mission 21 of 30Expert

Delinquency aging bucket pivot by product

Conditional COUNT pivot across the active book, sliced by product subcategory

Back to Consumer Lending Analyst

The Brief

Tony CostaLoan Servicing Leadconsumer-lending

Standing aging report for the servicing committee. Pivot the active book by `current_status` across product subcategory. Seven columns: `subcategory`, `current_count`, `dpd_30`, `dpd_60`, `dpd_90`, `charge_offs`, `total_active`. Active means anything except `paid_off` or `refinanced` — those loans aren't ours to service anymore. Sort by `subcategory` ascending.

You'll practice

Conditional COUNT pivotActive-book filter

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_applicationsfact18 columns
ColumnTypeKey
app_idINTPK
customer_idINTFK → retail_customers
product_idINTFK → retail_products
application_dateTEXT
requested_amountREAL
requested_termINT
loan_purposeTEXT
action_takenINT
denial_reason_1INT
aus_recommendationTEXT
rate_spreadREAL
lien_statusINT
occupancyINT
ethnicityINT
raceINT
sexINT
age_bucketTEXT
property_tractTEXTFK → lending_geography
retail_productsdim6 columns
ColumnTypeKey
product_idINTPK
product_codeTEXT
product_nameTEXT
categoryTEXT
subcategoryTEXT
default_aprREAL

Hints (3)

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

Hint 1

Three-table JOIN to reach product subcategory: originations → applications → products.

Hint 2

Active-book filter: exclude the two terminal closed states (paid-off and refinanced). Both are off your books; including them dilutes every bucket count and the rates in the next slide.

Hint 3

Each delinquency-bucket column is a conditional SUM gated on a single status value. `total_active` is just COUNT(*) over the same active-filter — useful as the proportion-denominator for the rate slide that follows this one.