Skip to content

What are Slowly Changing Dimensions (SCD)?

Slowly Changing Dimensions are techniques for managing changes to descriptive data over time and choosing which historical values to keep for reporting.

Slowly Changing Dimensions (SCD) are techniques for deciding how to preserve the history of descriptive information about customers, products, or other entities. In an analytical data store, a dimension is a table that gives context to a fact, such as the product category associated with a sale. If the product changes category, a report on past sales can show either the original category or the current one. Which one applies depends on the business question and the rule chosen for each attribute. Some techniques overwrite the value, while others keep successive versions. Keeping versions is not enough, though: each sale must be linked to the version in effect when it occurred, and the source data must make it possible to reconstruct that point in time. The choice involves report users, data stewards, and whoever must verify results over time.

See also: Star schemaA star schema organizes data for analysis into a central fact table, which holds the measurements, and into dimension tables that describe their context.

What history do you need to keep?

In Kimball's description, Type 1 overwrites the value and retains no history for that field. It suits error correction or cases where history is unnecessary, but it can also alter past reports. Type 2 adds a row for the new version, with its own surrogate key and a validity period. Type 3 moves the previous value into an alternate column and overwrites the main one, so it offers only a few views, not a full history.

Types can be mixed within one dimension: a master-data correction can follow Type 1 while a category change follows Type 2. The star schema entry covers how sales and dimensions fit together.

When changes are frequent

When some attributes change often, historical rows can multiply quickly. Kimball describes a mini-dimension (Type 4): attributes that change often, or are heavily used in a dimension with millions of rows, move to a separate table with its own key, stored in the fact table alongside the main dimension's key. Using one is optional and depends on the questions asked of the data and the maintenance cost.

Dates, delays, and reconstruction

If a sales record arrives late, Kimball advises looking up the version in effect on the event date, not the current one. A retroactive change to a Type 2 attribute requires inserting a new version and re-linking the associated facts. Backfills therefore need to be designed together with the correction rules.

An enterprise example

A distributor reclassifies a product. The head of sales wants to compare sales by the category assigned when each order was placed; the controller's office also wants a view based on the current classification. Each sale carries both the product version and the product code, which resolves to the current version. A late-arriving sale is linked to the category in effect on its date. A retroactive reclassification creates a new version, and the affected facts are re-linked to it.

Why it matters for decision makers

An RFP should state which history each field retains, which date determines validity, and who authorizes corrections. Asking for examples of a change, a late arrival, and a retroactive correction makes the proposed solution testable. The specification should also require checks for overlapping or missing intervals, plus report reconciliation: a versioned table alone cannot guarantee that the source supplied the entire history.

Frequently asked questions

Type 1 overwrites the value and retains no history for that field. Type 2 adds each new version as a new row, so facts can be linked to the value in effect when the event occurred.

No. It retains the versions it receives, but changes the source never recorded, or that occurred between two extracts, can be missing. Late arrivals and retroactive corrections also require explicit rules.

When a group of attributes changes often or is heavily used in a dimension with millions of rows. Those attributes move to a separate table with its own key, stored in the fact table. The choice depends on the analyses required and the cost of maintenance.
  • Star schemaA star schema organizes data for analysis into a central fact table, which holds the measurements, and into dimension tables that describe their context.
  • Kimball vs InmonTwo classic data warehousing philosophies: Inmon starts from a single normalized enterprise model, Kimball from dimensional data marts per business process.
  • Data lineageData lineage records where data originates, how it is transformed and which systems use it, making dependencies between tables, columns and reports visible.
  • Cumulative table designA pattern that accumulates historical metrics via incremental FULL OUTER JOIN, avoiding a full rescan of the window each run.
  • Junk dimensionA single dimension that gathers a transaction's low-cardinality flags and indicators instead of leaving them in the facts.

See it in the universe

If it touches your company's data, getting that data in order is the first thing I do.

See Data Foundations

Or write to me.