Mapping: SCD Type 2 Versioning

Mapping: SCD Type 2 Versioning

Posted by: Sreehari Desai

SCD Type 2 tracks historical data by creating multiple records for a given dimension entity (e.g Customer) with different versions. Unlimited history is preserved for each insert.

Overview

A Slowly Changing Dimension (SCD) is a dimension that stores and manages both current and historical data over time in a data warehouse. It is considered and implemented as one of the most critical ETL tasks in tracking the history of dimension records.A Type 2 SCD retains the full history of values. When the value of a chosen attribute changes, the current record is closed. A new record is created with the changed data values and this new record becomes the current record. If the attribute changes the version numbers will be incremented sequentially.Each record contains the version number and flag. If the flag indicates ? Y? the record is latest and if the flag indicates ? N? then the record is outdated.The records with the highest version number is treated as an active record.In this Type 2 SCD, the old values will not be replaced, but a new row containing the new values will be added to the customer table. So at any point of time, the difference between the old values and new values can be retrieved and easily be compared. This would be very useful for reporting.
Cust_Key Cust_No Name City State Country Phone_No Version Flag
011001JohnNewYorkNYUSA83122222220Y
021002MichealNewYorkNYUSA98480223380N
031002MichealNewYorkNYUSA98480223381Y
041002MichealRaleighNCUSA98480223382Y

Features

System Requirements:

  • Informatica PowerCenter 9.1 or above.

Support