Analysts had no consolidated, real-time answer to three questions: what needs a response now, what's gone stale without follow-up, and what's the full state of everything still open. The data was all in the CRM — it just wasn't shaped for triage, and auto-acknowledgment emails made "needs response" counts noisy.
A pure-SQL notebook driven by a single :analyst_name parameter, cloned per analyst for isolated execution state. A UNION bridges current case status with full historical activity, and ROW_NUMBER / QUALIFY isolate the most recent activity per case without subquery nesting. Auto-acks are filtered by treating a short-window inbound right after an outbound as system-generated, and pure-SQL weekday arithmetic powers business-day stale-follow-up flags with no UDF or calendar table.
QUALIFY replaces nested subqueries for "most recent per case"CASE expressions derive urgency tiers automatically