display-medicalSCDs

Slowly Changing Dimensions ..

circle-exclamation

Workshop - Slowly Changing Dimensions (SCDs)

Dimension Lookup

circle-info

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

tr_scd
circle-info

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.

circle-exclamation
  1. In your DB management tool, execute the following statement.

DIM_SCD
circle-info

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.

  1. Add ‘London’ to the Data Grid.

Data grid - lookup
circle-exclamation
Configure fields
  1. Ensure that the Dimension Lookup / Update is set to: Lookup Mode.

set lookup mode
circle-info

Sets the step to Update Mode with lookup keys: id

There’s no point adding the LAST_UPDATE field as we're dealing with Type 1 changes.

  1. Click on the Fields tab.

Set city to string

circle-info

RUN the Transformation

x

  1. Click the Run button in the Canvas Toolbar.

  2. Click on the Dimension lookup/update step and Preview the data.

Preview data
circle-info

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

To maintain referential integrity, the record is assigned a TK 0, and as it doesn’t exist in the database, the value returned is NULL. As this is a lookup, no record is written to the database table.

Last updated

Was this helpful?