0% found this document useful (0 votes)
34 views

Slowly Changing Dimension: Rahma Hassan

This document discusses slowly changing dimensions (SCD) in data warehousing. SCDs allow dimension attributes that change over time, like customer details, to be tracked. There are five types of SCDs: Type 0 retains original attributes; Type 1 overwrites old values; Type 2 adds a new record; Type 3 adds new fields to track changes; and Type 4 uses a history table. Examples are provided to illustrate Type 0-3 SCDs. References for further reading on SCDs are also included.

Uploaded by

Radwa Ehab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Slowly Changing Dimension: Rahma Hassan

This document discusses slowly changing dimensions (SCD) in data warehousing. SCDs allow dimension attributes that change over time, like customer details, to be tracked. There are five types of SCDs: Type 0 retains original attributes; Type 1 overwrites old values; Type 2 adds a new record; Type 3 adds new fields to track changes; and Type 4 uses a history table. Examples are provided to illustrate Type 0-3 SCDs. References for further reading on SCDs are also included.

Uploaded by

Radwa Ehab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Slowly Changing

Dimension
Rahma Hassan
Introduction
Data warehouse is used to analyze historical data, it is essential to store the

different states of data.

Because our primary goal in data warehousing is to evaluate data from a historical

viewpoint, we may not be able to simply replace the data and will need to develop

special procedures to maintain the past while taking analytical and volume

characteristics of the data warehouse into account. This implementation is done

using Slowly Changing Dimensions in Data Warehouse.


What is SCD?
Is a dimension that is able to handle data attributes which change over time.

● A customer dimension may hold attributes such as name, address, and phone
number.
● Over time, a customer's details may change (e.g. move addresses, change
phone number, etc).
SCD Types
❏ Type 0 Retain Original

- Attributes never change (e.g. date of birth)

❏ Type 1 Overwrite

- Old values are overwritten with new values.

❏ Type 2 Add new record

- Track changes by creating multiple records


SCD Types
❏ Type 3 Add new field

- Track changes using separate columns

❏ Type 4 History Table

- For each change in the source system,


a record will be added to the history table
Example of Type 0
Dimension attributes never change.
Example of Type 1
When new data arrives, the old attribute value
in the dimension row are overwritten
with the new value.
Example of Type 2
A new row is added to the dimension table
with the updated attribute values.
Example of Type 3
When new data arrives, a secondary column, preserves the old value,
the new value overwrites the primary column.
References
- Wikipedia > Slowly changing dimension
- Medium > Data Analyst’s Primer to Slowly
Changing Dimensions
- TAYGAN > Slowly Changing Dimensions
(SCD)
Thanks!
[email protected]
LinkedIn: Rahma Hassan

You might also like