Transaction Fact Table
One row per sale, payment, or click, at the finest grain the process records. Transaction fact tables answer “what happened” directly; state takes more work.
One row per sale, payment, or click, at the finest grain the process records. Transaction fact tables answer “what happened” directly; state takes more work.
A warehouse gives each dimension row its own meaningless number, so one customer can have several historical versions, each with a key a fact can point to.
When an employee rejoins with a new number or two customer records turn out to be one person, a durable key keeps a single identity across every change.
Wrong totals rarely raise an error. See why grain is a contract, which facts you may not sum, and the join that inflates a number without warning.
A balance can be summed across accounts but not across days. Semi-additive facts need a point in time or an average along the dimension where sums are nonsense.
A periodic snapshot stores the state of every account or product once per day or month, including quiet ones, so “what was it then” becomes a simple read.
Ratios and distinct counts cannot be added up, and averaging them is usually wrong too. Store the additive parts, aggregate those, and compute the ratio last.
A customer number or SKU identifies a record in its source system. It is essential for tracing data back, and unreliable as the only key a warehouse joins on.
To compare orders with shipments, do not join the two fact tables. Query each at the report’s grain on shared attributes, then merge the results.
Orders, shipments, and returns can be compared by customer or month only if those attributes mean exactly the same thing in each. That is a conformed dimension.
One row per order, updated as it is picked, shipped, and delivered. An accumulating snapshot makes lead times a subtraction, but keeps one date per step.
One schema cannot serve both a transaction and a decade of history. Here is what each model is designed to protect, and what breaks when the two are confused.