Public Medicare Part D analytics in Snowflake: Part D Specialty Economics (drug mart and specialty flag) and Part D Prescribers Explorer (national 2024 aggregates) — both on Tableau Public.
Drug Path
CMS publishes national Medicare Part D drug-spend files that are free to use, but they arrive wide by year and need clear modeling before they support reliable analysis — including a documented specialty flag aligned to CMS specialty-tier economics.
Outcome: Part D Spending by Drug loaded into Snowflake (as-loaded raw layer, then a drug-by-year mart), a specialty flag based on average spend per beneficiary versus CMS’s $950 specialty-tier monthly cost threshold, quality checks on row counts, and a Tableau Public dashboard from a mart extract.
Part D Specialty Economics — drug mart preview (Tableau toolbar at the bottom of the frame).
Small warehouse layers: as-loaded raw data, an analysis mart with explicit grain (brand × generic × year), then a mart extract for Tableau Public.
flowchart TB A["CMS Part D Spending by Drug"] --> B["Snowflake RAW"] B --> C["Snowflake MART"] C --> D["CSV extract"] D --> E["Tableau Public"]
Part D plans use a CMS specialty-tier cost threshold of $950 for a 30-day equivalent supply (CY 2024–2026 bidding guidance). The mart’s specialty flag marks drugs whose average Part D spend per beneficiary, divided by 12, meets or exceeds that monthly bar:
est_monthly = avg_spnd_per_bene / 12 specialty flag = (est_monthly ≥ 950)
That is a documented cost proxy, not an official formulary “specialty” label. Very large national spend can still sit below the flag when many beneficiaries share the total (for example common chronic therapies).
| Check (2024) | Result |
|---|---|
| RAW rows | 14,536 |
| Overall drug groups | 3,625 |
| Specialty flag TRUE | 685 |
| FALSE / null | 2,741 / 199 |
Prescriber Path
Ranking prescribers only by pharmacy claim volume hides cost concentration. CMS publishes a large public prescriber-by-drug file (~28M rows for 2024). Interactive charts should hit pre-aggregated marts — not scan tens of millions of rows in Tableau Public.
Outcome: full national fact in Snowflake, the 685 drugs with specialty flag TRUE joined in, NPI-level AGG marts, and Part D Prescribers Explorer on Tableau Public (map, filters, top people by drug cost and pharmacy claims). Headline: cost leaders and claim leaders are largely different people.
Part D Prescribers Explorer — filters, map, and top lists on drugs with specialty flag TRUE. Loads when you open this tab.
Scale path: load the full public fact once, serve charts from AGG marts only. Tableau Public never receives the 28M-row fact.
flowchart TB A["CMS Part D Prescribers 2024"] --> B["Snowflake RAW ~28M rows"] B --> C["AGG marts for specialty-flag drugs"] C --> D["Extract"] D --> E["Tableau Public"]
The specialty flag is defined on the drug mart (Specialty Economics view). This path uses those 685 drugs and AGG marts — not the drug-spend year mart alone.
One project stack covers both views (specialty economics and the prescribers explorer).
| Layer | Choice | Why |
|---|---|---|
| Source | CMS data.cms.gov | Drug spend + prescriber PUFs (public) |
| Warehouse | Snowflake | RAW + MART / AGG; X-Small; re-runnable SQL |
| Transform | SQL + Python loader | Drug mart + specialty flag; full prescriber load + AGG |
| BI | Tableau Public | Extracts of marts — not 28M rows in the browser |
| This site | Static embed | Preview + full-page links to Public |
View a public Tableau dashboard?
Brief project notes are enough — I reply by email.