Data modeling

Facts tell; dimensions explain

A useful analytical model separates what happened from the context needed to interpret it.

Inspired by The Data Warehouse Toolkit by Ralph Kimball and Margy Ross. This is an original explanation, not a reproduction of the text.

The idea

Imagine a business event as a sentence: “Three units sold for twelve dollars on Tuesday at the downtown shop.” The measurable parts—units and dollars—are facts. The descriptive parts—date, product, and shop—are dimensions.

Facts answer “how much?” or “how many?” Dimensions answer “which one?”, “where?”, “when?”, and “for whom?” Keeping those roles distinct makes the same measurements easy to slice in many useful ways.

Make it concrete

For a coffee shop, one row might represent one line on a receipt. Its facts could be quantity, gross price, discount, and net price. Its dimensions could identify the drink, customer, store, cashier, promotion, and time. You can then ask for net sales by store, by drink, by morning versus afternoon—or combine those views—without redefining a sale.

The modeling question

Before choosing columns, state exactly what one fact row represents. A receipt, a receipt line, and a daily store total are different grains. Mixing them invites double-counting. Choose one grain, record measurements at that grain, then attach the dimensions that describe it.

Keep this: Decide what one row means first. Put measurements in facts and the words used to filter or group them in dimensions.

Try it

Pick one event from your work. Finish this sentence precisely: “One row represents ___.” Now list three numbers you would measure and three labels you would use to group them.