Beruflich Dokumente
Kultur Dokumente
A typical slowly changing dimension is a dimension in which the detailed description of a given attribute is occasionally adjusted. There are three main techniques for handling slowly changing dimensions in a data warehouse. Refer below attachment for more details on a case study on implementation of slowly changing dimension
ETL
Fig.1.Type1
ETL
Fig.2
ETL
Fig.3
Fig.4.Lookup_Transformation Stage 1) Connect to the Source table by editing the Source_Product_Table Stage. 2) Connect to the Target table as a lookup by editing Look_up_on_Target Stage 3) Create the mappings for Intermediate lookup Transformation as shown in fig.4 4) Set the constraint to update the changed dimension as (DSLink8.ID = DSLink9.ID) And IsNull(DSLink9.ENDDATE) 5) Set the constraint for inserting new product as IsNull(DSLink9.ID) 6) I n the link properties check the Reference link with multi row result set box.
ETL
Fig.5.Update_Insert_Transformation 7) I f the Product Id is existing in next transformation compare Product description by setting the constraint
ETL
8) (SLink10.olddesc <> DSink10.newdesc) as shown in Fig.5. 9) Update Effective end date for DS Link12 and Insert new product description by generating a surrogate key using DS Transform KeyMgtGetNextValue for the KEY field DS Link 13.
Fig.6.New_Product_Insert_Transformation 10) Else If the Product Id is new insert a new row with the values from source table. For KEY generate next sequence no by calling DS Transform KeyMgtGetNextValue as shown in Fig.6
Fig.7
Fig.8 1) Connect to the Source table by editing the Source_Product_Table Stage. 2) Connect to the Target table as a lookup by editing Look_up_on_Target Stage
Fig.9.Lookup_Transformation 3) Create the mappings for Intermediate lookup Transformation as shown in fig.9 4) Set the constraint to update the changed dimension as (DSLink8.ID = DSLink9.ID) And IsNull(DSLink9.ENDDATE) 5) Set the constraint for inserting new product as IsNull(DSLink9.ID) 6) I n the link properties check the Reference link with multi row result set box.
Fig.10.Update_Insert_Transformation 7) I f the Product Id is existing in next transformation compare Product description by setting the constraint (SLink10.olddesc <> DSink10.newdesc) as shown in Fig.10.
8)
Update Version for DS Link12 and Insert new product description by generating a surrogate key using DS Transform KeyMgtGetNextValue for the KEY field DS Link 13
Fig.11. New_Product_Insert_transformation 9) Else If the Product Id is new insert a new row with the values from source table. For KEY generate next sequence no by calling DS Transform KeyMgtGetNextValue as shown in Fig.11 Ex3. Updating Version
Fig.12
Fig.13 1) Connect to the Source table by editing the Source_Product_Table Stage. 2) Connect to the Target table as a lookup by editing Look_up_on_Target Stage
Fig.14.Lookup_Transformation 3) Create the mappings for Intermediate lookup Transformation as shown in fig.14 4) Set the constraint to update the changed dimension as (DSLink8.ID = DSLink9.ID) And IsNull(DSLink9.ENDDATE)
ETL Strategy for DataStage .
10
5) Set the constraint for inserting new product as IsNull(DSLink9.ID) 6) I n the link properties check the Reference link with multi row result set box.
Fig.15.Update_Insert_Transformation 7) I f the Product Id is existing compare Product description by setting the constraint (SLink10.olddesc <> DSink10.newdesc) as shown in Fig.15. 8) Then Update Existing row and Insert new product description by generating a surrogate key using DS Transform KeyMgtGetNextValue for the KEY field DS Link 13 as shown in Fig.15
Fig.16.Product_New_Insert_Transformation 9) Else If the Product Id is new insert a new row with the values from source table, and Version No as 1. For KEY generate next sequence no by calling DS Transform KeyMgtGetNextValue as shown in Fig.16
11
12
Fig.19.Lookup_Transformation 3) Make the Mappings as shown in Fig.19 for Lookup_Transformation Stage 4) Set the constraint (DSLink4.PRODUCT_ID=DSLink5.PRODUCT_ID) For DS Link 9 to check whether Product Id is existing. 5) Set the constraint IsNull(DSLink5.PRODUCT_ID) to check whether it is a new Product Id insert.
Fig.20.Update_Transformation 6) If the Product Id is existing Make Update and Insert Operations as shown in Fig.20 .
13
14