SCDs
Slowly Changing Dimensions ..
Workshop - Slowly Changing Dimensions Type 1 & 2
The workshop illustrates the key concepts and workflows for dealing with Slowly Changing Dimensions.
In this workshop, you are going to create a dimension table DIM_SCD, which will have:
technical key field
version field
date from and date to fields
Id field
name field
The technical key will become the primary key for the dimension table.
The version field sets the record version (increments) on an update or insert.


The following content has been automatically generated by an AI system and should be used for informational purposes only. We cannot guarantee the accuracy, completeness, or timeliness of the information provided.
Any actions taken based on this content are at your own risk. We recommend seeking qualified expertise or conducting further research to validate and supplement the information provided.
Create a new Transformation
Any one of these actions opens a new Transformation tab for you to begin designing your transformation.
By clicking File > New > Transformation
By using the CTRL-N hot key
SCD table
First step in these series of workshops, is to create a simple DIM_SCD table that has the required fields to illustrate a Type 1 change - just overwrite the value - and Type2 - where you need to record when any change in the value occurs.
Create the Table in MySQL sampledata database.
In your DB management tool, execute the following statement.
CREATE TABLE `DIM_SCD` (
`TK` bigint(10) NOT NULL,
`version` int(11) DEFAULT '0',
`id` int(11) DEFAULT '0',
`city` tinytext,
`date_from` datetime DEFAULT NULL,
`date_to` datetime DEFAULT NULL,
`last_update` datetime DEFAULT NULL,
PRIMARY KEY (`TK`),
KEY `idx_DIM_SCD_lookup` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Lookup
This step is rarely used for lookups as specific steps exists; however, it does illustrate the database process of how referential integrity is maintained.
Add ‘London’ to the Data Grid.

To initially configure the fields set the step to Update mode.
Once completed remember to reset to lookup mode.

Ensure that the Dimension Lookup / Update is set to: Lookup Mode.

Click on the Fields tab.

RUN the Transformation
Click the Run button in the Canvas Toolbar.
Click on the Dimension lookup/update step and Preview the data.

Why does London have a TK 0 and a value of NULL?
Last updated