source : col1 101 101 101 102 102 102 103 103 103
col2 1000 1500 2000 1200 2300 3000 2400 1300 2000
i need target as
col1 101 102 103
col2 1000,1500,2000 1200,2300,3000 2400 1300 2000

Answers were Sorted based on User's Feedback



source : col1 101 101 101 102 102 102 103 103 103 col2 1000 1500 2000 1200 2300 30..

Answer / s

INPUT
col1 col2
101 1000
101 1500
101 2000
102 1200
102 2300
102 3000
103 2400
103 1300
103 2000

OUTPUT
col1 col2
101 1000,1500,2000
102 1200,2300,3000
103 2400,1300,2000


SOURCE->SRT->EXP->TGT

SRT - Sort by column col1.
EXP - col1
col2
v_col2=iif(v_col1=col1,v_col2||','||col2,col2)
v_col1=col1
o_col1=v_col1
o_col2=v_col2

Is This Answer Correct ?    11 Yes 3 No

source : col1 101 101 101 102 102 102 103 103 103 col2 1000 1500 2000 1200 2300 30..

Answer / john coder

i believe, we need an aggregator to pick up the last row for
a particular deptno.

Otherwise, there will be three rows inserted...

col1 col2
101 1000
101 1000,1500
101 1000,1500,2000

by having an aggregator with groupby on col1, we can pick up
the last row by either using LAST or MAX.

Is This Answer Correct ?    8 Yes 0 No

source : col1 101 101 101 102 102 102 103 103 103 col2 1000 1500 2000 1200 2300 30..

Answer / balaganesh

SQ-->SRT-->EXP-->AGG-->TGT

In SRT:
sort the record by col1 (Ascending)

In Exp:
col1
col2

v_col2=iif(v_col1=col1,v_col2||','||col2,col2)
v_maxcount=iif(v_col1=col1,v_maxcount+1,1)
v_col1=col1
o_col1=v_col1
o_col2=v_col2
o_maxcount=v_maxcount

In AGG:
Group by o_col1
MAX(o_maxcount)

Is This Answer Correct ?    1 Yes 0 No

source : col1 101 101 101 102 102 102 103 103 103 col2 1000 1500 2000 1200 2300 30..

Answer / venky

src->exp->agg->tgt

exp transformation

col1
col2
var1=iff(var2=col1,var1||','||col2,col2)
var2=col1
output=var1

agg transformatiom

col1 select group

Is This Answer Correct ?    0 Yes 0 No

source : col1 101 101 101 102 102 102 103 103 103 col2 1000 1500 2000 1200 2300 30..

Answer / anoymous

If the source is Relational then source qualifier can be
overridden

Select Col1, Concat('col1',',','col2') from table name
groupby col1;

Is This Answer Correct ?    0 Yes 4 No

source : col1 101 101 101 102 102 102 103 103 103 col2 1000 1500 2000 1200 2300 30..

Answer / kiran

USE SOTER TR . IN SORTER TR CLICK ON DISTINCT OPTION IT ELIMINATE THE DUPLICATE AS WELL AS SORT THE ORDER.

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More Informatica Interview Questions

What are the active and passive transforamtions?

2 Answers  


Whatis the difference between View and Materialized View ?

11 Answers   Satyam, Syntel,


What does role playing dimension mean?

0 Answers  


What is difference between a connected look up and unconnected look up?

6 Answers  


What could be the possible resons of locks by user?

0 Answers  






what is the size of your data warehousing?

0 Answers   IBM,


write sql query to remove null value following table id name 101 dinesh null jyothi null bharathi 102 suresh null shilpha 103 prakesh null suma i want the output id name 101 dinesh 102 suresh 103 prakesh

5 Answers   Accenture,


How to run a session, which contains mapplet?

1 Answers  


what is the method of error handling when session is running?

1 Answers   TCS,


what is update strategy transformation ?

7 Answers   TCS,


there is a product table prodid prodname price 100 cinthol 10 101 hamam 10 102 neem 20 103 cake 30 in the above table the price of some products are duplicated and some product prices are distinct we want to push the duplicated prices to one target and non-duplicated prices to other target without using expression and sequence generator transformation

3 Answers  


how can u generate sequence of values in which target has more than 2billion of records.(but with sequence generator u can generate upto 2 biliion only)

6 Answers   Accenture,


Categories