Latest News

Monday, December 11, 2017

Slowly Changing Dimension Type 2


SCD type 2 stores the entire history the data in the dimension table. With type 2 we can store unlimited history in the dimension table. In type 2, you can store the data in three different ways. They are

  1. Versioning
  2. Flagging
  3. Effective Date


SCD Type 2 Versioning: In versioning method, a sequence number is used to represent the change. The latest sequence number always represents the current row and the previous sequence numbers represents the past data.

Example a customer (Deb) moves from Cuttack to Bangalore and the version number will be incremented. The dimension table will look as below

SCD Type 2 Flagging: In flagging method, a flag column is created in the dimension table. The current record will have the flag value as 1 and the previous records will have the flag as 0.

SCD Type 2 Effective Date: In Effective Date method, the period of the change is tracked using the start_date and end_date columns in the dimension table.

  • Google+
  • Pinterest
« PREV
NEXT »

No comments

Post a Comment