To edit a Slowly Changing Dimension (SCD) stage, you must define how the stage looks up
data in the dimension table, obtains surrogate key values, updates the dimension table, and writes
data to the output link.
Before you begin
Before you edit the SCD stage, you must edit the stages on the input links:
- In the source stage, specify the file name for the data source and define the column metadata.
Verify that the source data is sorted correctly.
- In the dimension reference stage, specify the table name and connection properties for the
dimension table, and define the column metadata.
Procedure
- Open the SCD stage properties panel.
- On the Stage tab, in the Properties
section, select the output link.
By default the first output link that you connect to the
SCD stage is set as the output link.
- On the Input tab, define the input data to the stage:
- Select the reference link in the Input name field.
- In the Lookup section, click Edit. The
Edit lookup page opens.
- Open the drop-down list in one row of the Purpose column and
select a value. Then, in the same row, select a value in the Key Expression
column.
- If you are using a Surrogate Key Generator stage to maintain the key source, specify
information about the key source by clicking in the Purpose column of the row
that has the key source, then selecting "Surrogate key".
- In the Purpose column, select appropriate values for the rest
of the rows. Then, click Apply and return.
- In the Surrogate key section, specify the necessary information, then click
Save.
- On the Output tab, define the output data from the stage:
- If the stage has multiple output links, select the link that you want to configure
from the drop-down list. If the stage has one output link, go to the next step.
- In the Columns section, click
Edit.
- On the Edit columns page, create column derivations to specify
how to detect and apply changes to dimension records.
- On the Output Map tab, map data from the input links to the
output link.
- Click Save.
What to do next
After you edit the SCD stage, you must edit the stages on the output links:
- If you are updating the dimension table in the current job, specify the name and connection
properties for the dimension table, set the Write method property to
Upsert, and set the Upsert Mode property to
Auto-generated Update & Insert. You do not need to define column metadata
because the SCD stage propagates the column definitions from the dimension reference link to the
dimension update link.
- If you are loading the fact table in the current job, specify the table name and connection
properties for the target database, and select any write method. The column metadata is already
defined by the mappings that you specified in the SCD stage.