You own the sales-compensation dbt project at a B2B software company. Every quarter, payroll pays reps straight from the rep_commissions mart. The Q1 2026 statement has just been built and finance has frozen the payout: it comes to $72,600 against a budget of roughly $29k. Some of the questions already on the table: the statement credits 8 deals in Q1, but sales ops can only find 6 deals that are closed-won in the CRM today. Ana Ruiz is credited with a Northwind deal that closed on the day she handed that account over to Ben Okafor. Chloe Lin's Q1 bookings include an Umbrella deal the customer cancelled during its cooling-off period. Ben's EUR deal with Globex is booked at exactly its face value in dollars. And even after you account for those, the commission amounts for reps who beat quota look too generous.
The project is a four-layer DAG. Four raw seeds (raw_reps, raw_account_ownership, raw_crm_deals, raw_fx_rates) feed four staging models. Two intermediate models convert deals to USD (int_deals_usd) and credit each deal to a rep (int_deal_credit). The rep_commissions mart then applies the comp plan. Each model's header comment documents its contract, and models/schema.yml describes the grain of each model.