Slowly Changing Dimensions

A slowly changing dimension (SCD) is one that appropriately manages the change of dimension members over time. It applies when the values of a business entity change over time, and not on a set schedule.


a set of fields to track when the record was added and modified.

Types of SCD -

  • Type 0 – Fixed Dimension
    • No changes allowed, dimension never changes
  • Type 1 – No History
    • Update record directly, there is no record of historical values, only current state
  • Type 2 – Row Versioning
    • Track changes as version records with current flag & active dates and other metadata
  • Type 3 – Previous Value column
    • Track change to a specific attribute, add a column to show the previous value, which is updated as further changes occur
  • Type 4 – History Table
    • Show current value in dimension table but track all changes in separate table
  • Type 6 – Hybrid SCD
    • Utilise techniques from SCD Types 1, 2 and 3 to track change


including type 3 and type 6.

Confusingly, there is no SCD type 5 in commonly agreed definitions.

After you have implemented your chosen dimension type, you can then point your fact records at the relevant business or surrogate key. Surrogate keys in these examples relate to a specific historical version of the record, removing join complexity from later data structures.


A type 0 SCD the table remains the same. This means our existing reports will continue to show the same figures, maybe it is a business requirement that each customer is always allocated to the country they signed up from.


In order to support type 2 changes, we need to add four columns to our table:

· Surrogate Key – the original ID will no longer be sufficient to identify the specific record we require, we therefore need to create a new ID that the fact records can join to specifically.

· Current Flag – A quick method of returning only the current version of each record

· Start Date – The date from which the specific historical version is active

· End Date – The date to which the specific historical version record is active


A type 4 SCD , has no change to existing table here, we simply update the record as if a Type 1 change had occurred. However, we simultaneously maintain a history table to keep track of these changes:

Our Dimension table reads:

tracking dimension table

Whilst Type 4 historical table is created as:

Historical data in customer dimension table

Depending on  requirements, place both ID and Surrogate Key onto the fact record so as to optimise performance whilst maintaining functionality.

Separating the historical data makesthe dimensions smaller and therefore reduces complexity and improves performance if the majority of uses only need the current value.

However, if you do require historical values, this structure adds complexity and data redundancy overheads. It is generally assumed that the system will use Type 1 or Type 2 rather than Type 4.


Comments