Retail Banking Operations Path · Mission 22 of 30Expert

Tier-break top-up candidates (Savings/MMA)

Latest-snapshot range filtering for behavioral targeting

The Brief

Jordan KimTreasurerretail-ops

We're modeling a tiered-rate offer to lift balances over the $25K break. Pull the candidate list — Savings or MMA accounts at the latest snapshot whose ledger_balance is below $25K but at least $20K (so a small top-up gets them over). Output `account_id`, `customer_id`, `subcategory`, `current_balance` (rounded 2), `dist_to_25k_break` (25000 − current, rounded 2). Treat the miscased 'savings' subcategory as a Savings entry. Sort by dist_to_25k_break ascending so the closest-to-the-line accounts surface first.

You'll practice

Latest-snapshot range filterBehavioral targeting

Tables & columns available

retail_balance_dailyfact8 columns
ColumnTypeKey
snapshot_idINTPK
account_idINTFK → retail_accounts
snapshot_dateTEXT
ledger_balanceREAL
available_balanceREAL
interest_rateREAL
days_overdrawnINT
delinquency_statusTEXT
retail_accountsdim13 columns
ColumnTypeKey
account_idINTPK
customer_idINTFK → retail_customers
product_idINTFK → retail_products
branch_idINTFK → retail_branches
open_dateTEXT
close_dateTEXT
statusTEXT
ownership_typeTEXT
interest_rateREAL
original_balanceREAL
credit_limitREAL
fico_at_origINT
maturity_dateTEXT
retail_productsdim10 columns
ColumnTypeKey
product_idINTPK
product_codeTEXT
product_nameTEXT
categoryTEXT
subcategoryTEXT
default_aprREAL
default_apyREAL
monthly_feeREAL
nsf_feeREAL
od_feeREAL

Hints (3)

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

Hint 1

Latest snapshot per account is the same `ROW_NUMBER PARTITION BY account ORDER BY snapshot_date DESC` pattern you used in M19 / M21. Keep `rn = 1`.

Hint 2

Filter the subcategory IN ('MMA', 'Savings', 'savings') — the lowercase row is a known data bug from M2 / M3 which still needs to be included here.

Hint 3

Range filter on the latest balance using the bounds in the briefing. The upper bound is half-open — at exactly $25K the account already qualifies for the next tier, so it's not a candidate.