Sie sind auf Seite 1von 1

New_Flag = IIF(ISNULL(Cust_Key),1,0)

Changed_Flag = IIF(NOT ISNULL(Cust_Key)


AND (Name != Src_Name
OR Location != Src_Location),
1, 0 )

Now connect the ports of lkp transformation (Cust_Key, Name, Location) to the
expression transformaiton ports (Cust_Key, Name, Location) and ports of source
qualifier transformation(Name, Location) to the expression transforamtion
ports(Src_Name, Src_Location) respectively.
The mapping diagram so far created is shown in the below image.

Create a filter transformation and drag the ports of source qualifier


transformation into it. Also drag the New_Flag port from the expression
transformation into it.
Edit the filter transformation, go to the properties tab and enter the Filter
Condition as New_Flag=1. Then click on ok.
Now create an update strategy transformation and connect all the ports of the
filter transformation (except the New_Flag port) to the update strategy. Go to the
properties tab of update strategy and enter the update strategy expression as
DD_INSERT
Now drag the target definition into the mapping and connect the appropriate ports
from update strategy to the target definition.
Create a sequence generator transformation and connect the NEXTVAL port to the
target surrogate key (cust_key) port.
The part of the mapping diagram for inserting a new row is shown below:

Now create another filter transformation and drag the ports from lkp transformation
(Cust_Key), source qualifier transformation (Name, Location), expression
transformation (changed_flag) ports into the filter transformation.
Edit the filter transformation, go to the properties tab and enter the Filter
Condition as Changed_Flag=1. Then click on ok.
Now create an update strategy transformation and connect the ports of the filter
transformation (Cust_Key, Name, and Location) to the update strategy. Go to the
properties tab of update strategy and enter the update strategy expression as
DD_Update
Now drag the target definition into the mapping and connect the appropriate ports
from update strategy to the target definition.
The complete mapping diagram is shown in the below image.

Recommended Reading

Learn how to Design Different Types of SCDs in informatica

SCD Type 1
SCD Type 3
SCD Type 2 version
SCD Type 2 Flag
SCD Type 2 Effective Date

Das könnte Ihnen auch gefallen