Tuesday 6 May 2014

Convert column into row without using Normalizer Transformation


Source is
ID YEAR1 YEAR2 YEAR3
1 200 300 400
2 500 600 700

Output 
ID YEAR
1     200
1     300
1     400
2     500
2     600
2     700
Achieve the result without using Normalizer Transformation. 

Solution:

1. Bring the source in to the mapping designer.
2. Create three expression transformation.
3. Drag ID and YEAR1 ports from the source qualifier into the first expression.
4. Drag ID and YEAR2 ports from the source qualifier into the second expression
5. Drag ID and YEAR3 ports from the source qualifier into the third expression.
6. Take a UNION transformation and create three ports.
7. Drag ports from the first expression transformation into the first group of union transformation.
8. Drag ports from the second expression transformation into the second group of union transformation.
9.  Drag ports from the third expression transformation into the third group of union transformation.
10. Take a sorter transformation and sort on id.
11. Now connect to the target.
That's all and final mapping is


No comments:

Post a Comment