The Case Transform is used to route one row to different outputs depending on conditions. Specifies multiple paths in a single transform (different rows are processed in different ways).
The Case transform simplifies branch logic in data flows by consolidating case or decision making logic in one transform. Paths are defined in an expression table.
Here I have taken an example EMPLOYEE table.
Employee Location are 3 coutries - IN,SG and US.
Requirement:
To load the LOCATION data into 4 different tables.
If LOCATION=IN then load the data into IN_EMP
If LOCATION=SG then load the data into SG_EMP
If LOCATION=US then load the data into US_EMP
If LOCATION is other than IN,SG and US then load the data into OTHER_EMP
Bring the Case Transform after the Query Transform as shown below:
Inside the Case Transform use the code as shown in below screen.
Run the Job to load the data as per our Case transform logic and check.