Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 15

BODS slowly changing dimension – Type 2

Create the database table as follows

Log into DS Designer


Created new datastore DSDEC23 and import table created above
Make imported table as source

History Preserving: Creates a new row for each row flagged as update in the input data set.
Table Comparison: Compares tow data sets and produces the difference between them as a data set with rows flagged as insert
update or delete.
Key Generation: Generates artificial keys in the table starting after the maximum existing key value in the table

Create new target table as follows


Name it as EmpTarget. In the table
SID – Used for key generation
Curr_rec_ind – History preserving- N, O
Eff_From – Change data as logged in table
Eff_To – The change is valid till. This could be 100 years

Import target table


Take query transformation and rename it as sort. Connect source to sort.

Darg and Drop target table


Double click on query to get the fields and map them as shown

Delete the columns that are not in use


Delete the link between target and transformation Drag and drop history preserving and connect to the query transformation.
Double click on query transformation and select the following.
Drag and Drop history transformation and double click on it and select the following values
Drag and Drop key generation and double click and select the following values

Connect as shown
Data in target table
Data in Target Table
Now change phone number is EMP table of database for E002 record
Execute the same again. The target table is shown

For E002 the old record is marked as Z and the Eff_To Date is changed to the yesterday, Dec 23, 2012. For the new record that is Y,
the Eff_from data is today Dec 24, 2012.

You might also like