Tuesday, May 8, 2012

Concatinate duplicate values

MY SOURCE      MY TARGET
SNo Name
1 A
2 B
1 C
3 D
4 F
1 E
2 G
SNo Name
1 A
1 AC
1 ACE
2 B
2 BG
3 D
4 F

Solution:
  • Here the no. of rows in source and target tables are same; so here we think about Passive transformations.
  • After importing Source and Target, create a Sorter transformation to sort the data.
  • Then create an Expression transformation with 3 ports named say v_Name, v_SNo (2 variable ports) and o_Name (output port).
  • Give the expressions as follows
    • v_Name as variable port
    • IIF(SNo = v_SNo, v_Name||Name, Name)
    • v_SNO as variable port
    • SNo
    • o_Name as output port
    • v_Name
  • The final mapping looks like..
  • Finally connect the ports to Target, create and execute the session and workflow.

4 comments:

Related Posts Plugin for WordPress, Blogger...