Data & AI glossary
SCD (slowly changing dimension)
A technique that keeps the history of the attributes of a customer, a product or a store when they change, instead of overwriting the old value.
IN PRACTICE
Keeping a memory of changes.
SCD stands for “slowly changing dimension”. Two approaches dominate. Type 1 overwrites the old value. Type 2 adds a row at each change, with its validity dates: it is the one that keeps the history.
Example: a store changes region in the sales organisation. Without history, all its past sales move to the new region, and last year’s regional figures change after the fact. With type 2, each sale stays attached to the region of the time. In dbt, “snapshots” handle this.
The trap: history cannot be reconstructed. If the source overwrites its values and nothing recorded them, they are lost. So you need to decide early which attributes of a dimension deserve to be tracked. Conversely, keeping history for everything weighs down every query.
GO FURTHER
Read next.
WHAT COMES NEXT, WE BUILD TOGETHER
Your next project
starts with a conversation.
An idea, a pain point, a project to kick off? Let’s talk about what would make a difference for your teams.
Let’s talk about your project