Incident Lab · SEV2 · dbt
Last year's segment revenue changed overnight
Finance: 2024 business-segment revenue dropped by 400 since last week's board deck. Nobody reloaded 2024 orders.
dim customers is a type-2 dimension: each version of a customer has valid from (inclusive) and valid to (exclusive, NULL for the current version). revenue by segment joins orders to the current version only, so when a customer moves segment, all of their past orders move with them. Every upgrade rewrites history, which is what Finance just saw when customer 3 became enterprise . Reporting by segment needs the version that was valid on the order date . Investigate: Fix revenue by segment so each order is attributed to the segment valid on its order date : order date = valid from and order date < valid to (no upper bound when valid to is NULL ). Each order must count exactly once. Columns: segment , revenue (rounded to 2). Order by segment .
