Dimensions, Grain & Time-Series

The three knobs every metric exposes — and the time dimension that breaks naive engines.

0/2 done

Overview

A metric is a function of dimensions

A metric on its own is a single number. The interesting questions slice it: revenue by region, by product line, by week. Three knobs every metric exposes:

  1. Dimension — the discrete grouping column (region, channel, plan_tier).
  2. Grain — the minimum row identity of the underlying fact (one row per order, one row per session).
  3. Time — a special, ordered dimension with rules of its own (day, week starting Monday, fiscal quarter).

Why time is special

  • Cumulative metrics, lag/lead, period-over-period comparisons all depend on a consistent time grain.
  • Time zones and week-starts are a notorious silent bug source: WEEK(order_ts) returns different values in BigQuery, Snowflake and Postgres unless you pin the start day.
  • Slowly Changing Dimensions (SCDs) interact with time: revenue by customer_segment by month only makes sense if you pick as-of semantics (segment at order time vs segment today).

The semantic layer pins these decisions in one file. Every consumer that asks for revenue BY week gets the same Monday-anchored ISO week, every time.

Zoom and pan on the company photograph

A metric without dimensions is a photograph from a satellite at maximum zoom-out: useful but not actionable. Dimensions are the zoom and pan controls that let you ask 'show me Tokyo last Tuesday between noon and 1pm'. The time dimension is the zoom in time, and engines that don't pin its rules return blurry, inconsistent images depending on which camera you used.

Reflect

Audit one dashboard. For its primary KPI, write down the answers to: what is the time grain? Which time zone? Does the week start on Monday or Sunday? Are SCDs treated as-of-event or as-of-now? If you can't answer all four for every panel, you've found dashboards whose numbers depend on the warehouse's defaults rather than your team's decisions.

  • Which of your dashboards changes its top-line number when the warehouse upgrades its date functions?
  • What's the smallest contract that pins time grain, time zone and week-start across every consumer?

Reading in progress · 0 of 2 activities done