Skip to content

Glossary

Slowly changing dimension

A slowly changing dimension is a warehouse pattern for retaining or replacing changes to descriptive attributes over time.

Time and versioning

Also known as: SCD

A slowly changing dimension is a data-warehouse design pattern for attributes such as an organization's name or classification that change less often than transactional observations. Common variants overwrite the previous value, add a new versioned row, or preserve a limited prior value in another field. The choice determines which historical questions the warehouse can answer. The label describes a modeling technique, not a claim that the underlying world changes slowly.

In practice, versioned rows need effective intervals, a stable entity key, and a clear rule for attaching facts to the right version. Late-arriving changes can revise a past interval and expose a difference between the date an attribute applied and the date the warehouse learned it. An overwrite variant is simpler but loses earlier values. A versioned variant retains more history yet can still omit transaction time or evidence behind the change.

For a defensible report, dimension history helps explain which descriptive attributes were associated with a transaction at its date. It should not be confused with full point-in-time reproducibility: source versions, classification rules, and information availability may remain outside the dimension. Bitemporal data separates valid and recorded periods explicitly; a slowly changing dimension may implement only part of that distinction. The chosen variant should match the question the report must answer.

Example

Halden Therapeutics AG (fictional) changes its registered name; a versioned dimension keeps the former name for reports dated before the change.

The common types

Ralph Kimball's dimensional-modelling techniques name several ways to handle a change in a descriptive attribute. Type 1 overwrites the old value, keeping no history. Type 2 adds a new row for each change, with its own surrogate key and effective dates, so the history of the attribute is retained and facts link to the version that applied when they occurred; the Kimball Group's description of Type 2 gives the standard pattern. Type 3 adds a column holding the previous value, keeping limited history. Further types combine these. The Wikipedia article on slowly changing dimensions lists them with examples.

The pattern is a pragmatic technique for analytical reporting. Its value is that a report about last year's sales by region can use the region assigned to each customer at the time, while a report about the current structure can use the current assignment. Its limits are the reason this entry sits in a reference on defensible records.

What a Type 2 table does not give you

A Type 2 dimension tracks one time axis, usually the date the warehouse noticed the change, not necessarily the date the change took effect in the world. If a customer moved in March and the warehouse learned of it in May, the new row's effective date is either March, which rewrites what was known in April, or May, which misstates when the move happened. Choosing either loses information that a bitemporal design keeps. Corrections are also awkward: when a row is found to be wrong, the pattern does not say whether to edit it, which destroys the record of what the report showed, or to add a correcting row with its own dates.

Use Type 2 where the question is analytic and the late-arrival problem is minor, and design with bitemporal columns where the reconstruction of past beliefs matters, as in the compliance and audit uses discussed in the article on bitemporal data versus temporal knowledge graphs. The system-versioned tables described in the Microsoft documentation on temporal tables can supply the transaction-time axis that a plain Type 2 table lacks.

A worked example

A warehouse holds a supplier dimension for Halden Therapeutics AG (fictional) with an attribute for risk tier. In January the supplier is tier 2. In April a review moves it to tier 1, and a Type 2 row is added with an effective date of 1 April. In June an analyst discovers that the review actually took place in February and the load was late. Updating the effective date to February changes the tier shown for February and March in every report rerun from now on, and the March board report can no longer be reproduced. Adding a second row for the correction preserves the earlier report but leaves two rows with overlapping effective dates. A table with separate valid and transaction periods avoids both problems, because it records when the tier applied and when the warehouse learned of it.

Checks a reviewer can run

Ask which type each dimension uses and why. Ask what the effective date means: the date of the change in the world or the date of the load. Ask how corrections are handled and whether an earlier report can be reproduced after one. Test with a backdated change and see whether any past figure moves. Confirm that fact rows reference the dimension version that applied.

Related terms and boundaries

A slowly changing dimension keeps part of the history that bitemporal data keeps in full, and relates to valid time and point-in-time reproducibility. A surrogate key in Type 2 is a version identifier and should not be mistaken for a canonical identifier of the entity.

Common misreadings

  • Using an overwrite variant when historical names must be reported.
  • Treating the row's load date as the effective date.
  • Assuming a versioned dimension retains source evidence.

Related terms

Appears in

Found an error on this page? See corrections for what counts as one, how to report it and the dated log.

Enquiry

Where does "Slowly changing dimension" bear on a decision of yours?

This entry sits under time and versioning. If a decision in your organization turns on it, send the entity concerned, the sources you fuse to describe it and who may read which of them. We reply with what a first record would cover.

Or write to [email protected] in your own words.