If the source has duplicate records as id and name columns,
values:
1 a, 1 b, 1 c,
2 a, 2 b,
the target should be loaded as 1 a+b+c or 1 a||b||c, what
transformations should be used for this?

Answers were Sorted based on User's Feedback



If the source has duplicate records as id and name columns, values: 1 a, 1 b, 1 c, 2 a, 2 b, t..

Answer / shankar

SQ--->SORTER---->EXP---->AGR---->TGT

1.First pass all records into sorter
seect sort key on id.
2. An pass records into EXP
In exp creat 4 pors like
v_id=id
v_name=nme
v_name1=iif(id=v_id,name||'+'||v_name,name)
o_name=v_name1
3.Next pass all to agr
ini agr creat one port like
o_name_t=last(o_nme).
4.Pass to Target

Is This Answer Correct ?    8 Yes 0 No

If the source has duplicate records as id and name columns, values: 1 a, 1 b, 1 c, 2 a, 2 b, t..

Answer / babu

Sorry Shankar,

small mistake in your logic,

Exp Trans:
ID (I/O)
NAME (I)
V_NAME=IIF(ID=V_ID,V_NAME||'+'||NAME,NAME) (V)
V_ID=ID (V)
O_NAME=V_NAME (O)

=============
remaining is same.

Is This Answer Correct ?    2 Yes 0 No

If the source has duplicate records as id and name columns, values: 1 a, 1 b, 1 c, 2 a, 2 b, t..

Answer / mithilesh kumar rai

First Use Expression and then Use Aggregater
After Expression U will receive
1 a
1 a b
1 a b c
2 a
2 a b
2 a b c

then use aggregater group by key 'ID'
After Aggregater u will receive
1 abc
2 abc

Is This Answer Correct ?    2 Yes 2 No

If the source has duplicate records as id and name columns, values: 1 a, 1 b, 1 c, 2 a, 2 b, t..

Answer / souvik

We need to have a Lookup with a Dynamic Cache, a Router, an Expression and then an Update Strategy..... The Lookup will be on the Target Table..... So when the ID is coming for the first time, it wont found any data on the lookup table.... This can be directed for Insertion to the Target Table via a Router.... Then when the same ID is coming for the second time, it will Lookup on the Target Table and will found that the row with the ID exists.... Hence both the columns from the source table and both the columns from the Lookup are taken forward into the Router and then to an Expression Transformation where the second port is Concatenated. Then the ID port and this port is taken to the Update Strategy transformation for Update...

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Informatica Interview Questions

What is a difference between complete, stop and abort?

0 Answers  


In a scenario I have col1, col2, col3, under that 1,x,y, and 2,a,b and I want in this form col1, col2 and 1,x and 1,y and 2,a and 2,b, what is the procedure?

5 Answers  


How can you define a transformation? What are different types of transformations in Informatica?

10 Answers  


Is it possible to have "5 source & 5 Target" in single mapping?

1 Answers  


HAI FRIENDS THIS KISHORE FROM KUMBAKONAM. I HAVE COMPLETED MY MCA IN SASTRA UNIVERSITY WAITING FOR MY 6 TH SEM RESULT.DURING MY PROJECT I HAVE DONE INFORMATICA COURSE AS MY AREA INTEREST COURSE IN CORE MIND TECHNOLOGIES CHENNAI.I HAVE ENQUIRY ABT ALL IT PEOPLE FOR DATAWAREHOUSING THERE IS NO OPENING FOR FRESHERS. WITH SOME EXPERIENCE ANY OTHER DOMAIN TNEN ONLY U CAN GET THAT DOMAIN(DATAWAREHOUSING) JOB.BUT I AM MORE INTEREST ON THAT TO WORK ON THAT DOMAIN(INFORMATICA).WHAT TO I DO. I AM IN HELPLESS FRIENDS/EXPORTS.WAITING FOR REPLY

0 Answers  


What are the components of the workflow manager?

0 Answers  


i have a source with 100 records.i have 2 targets.in the first target i want to load first 50 records & in the second target i want to load next 50(or remaining) records.

3 Answers  


What are the main features of Oracle 8i with context to datawarehouse?

0 Answers  


is it possible to index the data in cache of lkp transformation ?

0 Answers  


What is polling?

1 Answers  


can we override a native sql query within informatica? Where do we do it? How do we do it?

0 Answers  


Lookup transformation, one condition is having SQL override (Empno < 10) and the other condition is Lookup (Sal>1000), which is dynamic. How will u resolve this situation?

1 Answers   IBM,


Categories