Source Like
department_no, employee_name
----------------------------
20, R
10, A
10, D
20, P
10, B
10, C
20, Q
20, S
and Output should be like this
department_no, employee_list
--------------------------------
10, A
10, A,B
10, A,B,C
10, A,B,C,D
20, A,B,C,D,P
20, A,B,C,D,P,Q
20, A,B,C,D,P,Q,R
20, A,B,C,D,P,Q,R,S
Answer Posted / srinivas
By using the stage variables in transformer we can do this.
Before going to use transformer sort the data based on two columns.Order should be like below
Deptno Empname
10 A
10 B
SO ON...
After that in transformer take 3 stage varibles
stg1--->map the sorted Deptcolumn
stg2---> DSLink2.empname:',' (map the empname column and concatenate comma operator)
Stg2--->stg3:stg2 (concatenate first two staging varibles)
Then
In derivation of employee_list column (In transformer)
use below function
TRIM(stg3,',','T')---->employee_list (column derviarion)
It will gives you as expected result.
Thanks
Sri
| Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
How you Implemented SCD Type 1 & Type 2 in your project?
Triggers,VIEW,Procedures
What are the components of ascential data stage?
how to add a new records into source?
What is the difference between informatica and datastage?
Is it possible to implement parallelism in Mainframe Jobs ? If Yes how ? If no why ?
Demonstrate experience in maintaining quality process standards?
I have a few records just I want to store data in to targets cycling way how?
Describe stream connector?
How many Key we can define in remove duplicate stage?
What are the different common services in datastage?
What is difference between server jobs & parallel jobs?
how to delete one row in target dataset
What is the flow of loading data into fact & dimensional tables?
Difference between server jobs & parallel jobs?