Source table
-------------
ID NAME
--- ------
101 PANKAJ
NULL KUMAR
NULL MATHUR
102 JYOTI
NULL SAXENA
103 SACHIN
NULL TENDULKAR


TARGET TABLE
-------------
ID NAME
--- -------
101 PANKAJ KUMAR MATHUR
102 JYOTI SAXENA
103 SACHIN TENDULKAR


How to do the above scenario in Informatica.

Answers were Sorted based on User's Feedback



Source table ------------- ID NAME --- ------ 101 PANKAJ NULL KUMAR NULL MATHUR 102 ..

Answer / babu

Hi Sbvprasad,
Your answer has small correction,

V1=iif(not isnull (id),id,v1)

for the 1st record.
V1= iif( not isnull (101), then pass 101).
now the V1 variable having the value = 101.

2nd record
V1= iif( not isnull ( null), then pass else condition V1 (
having 101 ))
now the V1 variable having the value = 101.

3rd record
V1= iif( not isnull ( null), then pass else condition V1 (
having 101 ))
now the V1 variable having the value = 101.

After applied the above logic we will get the output as
mentioned below.
-------------
ID NAME
--- ------
101 PANKAJ
101 KUMAR
101 MATHUR
102 JYOTI
102 SAXENA
103 SACHIN
102 TENDULKAR

2.Take an EXP t/r,in this t/r declare two variable ports
for ID and Name columns.those are PRV_ID and VAR_NAME

VAR_NAME=IIF(PRV_ID=ID,VAR_NAME||' '||NAME,NAME)
PRV_ID=ID
OP_NAME=VAR_NAME (OUTPUT PORT)

3.In the next step take the aggregator transformation and
group by on the ID COLUMN. Then you will get the result.

TARGET TABLE
-------------
ID NAME
--- -------
101 PANKAJ KUMAR MATHUR
102 JYOTI SAXENA
103 SACHIN TENDULKAR

MAPPING ::
---------

SRC-->SQ-->EXP-->EXP-->AGGR-->TRG
IF ANY THING WRONG, PLEASE CORRECT WITH PROPER SOLUTION.

Is This Answer Correct ?    2 Yes 0 No

Source table ------------- ID NAME --- ------ 101 PANKAJ NULL KUMAR NULL MATHUR 102 ..

Answer / nagraj

From SQ pass to Expression Transformation

- Take Variable for ID i.e.
V_ID =iif(not isnull(ID),ID ,V_ID )
- Take Variable for Name i.e.
iif( isnull(ID) ,CONCAT(CONCAT(LTRIM(RTRIM
(V_old_Name)),' ') ,Name),Name)

At this stage you will see the Data like this
ID Name
101 PANKAJ
101 PANKAL KUMAR
101 PANKAJ KUMAR MATHUR

Now pass the ID and NAME output port through an Aggregator
Transformation
-Take new variable for Name i.e.
New_Name=concat(concat(New_Name,' '),Name)
-Take new output port for Name and put expression for the
Name output port as follows
Out_Name=GREATEST(Name,New_Name)
- Check Group By on ID

Pass the ID and Name outpurt port to the Target.

option (truncate and load)



Where Group by on ID port

Is This Answer Correct ?    1 Yes 0 No

Source table ------------- ID NAME --- ------ 101 PANKAJ NULL KUMAR NULL MATHUR 102 ..

Answer / user

just take a variable port

then write the condition
decode(id,null,prev_id,id)

prev_id =id(it should be a variable port)

i m just giving an idea

Is This Answer Correct ?    0 Yes 1 No

Source table ------------- ID NAME --- ------ 101 PANKAJ NULL KUMAR NULL MATHUR 102 ..

Answer / sbvprasad

V1=iif(not isnull (id),id,v1)

for the 1st record.
V1= iif( not isnull (101), then pass 101).
now the V1 variable having the value = 101.

2nd record
V1= iif( not isnull ( null), then pass else condition V1 (
having 101 ))
now the V1 variable having the value = 101.

3rd record
V1= iif( not isnull ( null), then pass else condition V1 (
having 101 ))
now the V1 variable having the value = 101.

After applied the above logic we will get the output as
mentioned below.
-------------
ID NAME
--- ------
101 PANKAJ
101 KUMAR
101 MATHUR
102 JYOTI
102 SAXENA
103 SACHIN
102 TENDULKAR

2.In the next step take the aggregator transformation and
group by on the id. Then you will get the result.

TARGET TABLE
-------------
ID NAME
--- -------
101 PANKAJ KUMAR MATHUR
102 JYOTI SAXENA
103 SACHIN TENDULKAR

Is This Answer Correct ?    3 Yes 8 No

Post New Answer

More Informatica Interview Questions

Can one use mapping parameter or variables created in one mapping into any other reusable transformation?

0 Answers  


After dragging the ports of 3 sources sqlserver,oracle,informix to single source qualiofier can we map these ports directly to target and how?

2 Answers  


how to use incremental load?

2 Answers   TCS,


What is the difference between lookup override and souce qualifier override ?

2 Answers   Puma,


How can informatica be used for an organization?

0 Answers  






COM components can be used in Informatica

0 Answers  


What is 'PowerCenter Pushdown Optimization Option' in INFORMATICA ?

5 Answers  


How can yoU create or import flat file definition in to the warehouse designer?

2 Answers  


What are the types of maping wizards that r to be provided in Informatica?

2 Answers  


Why use the lookup transformation ?

2 Answers   Informatica,


Workflow is long running due to long running sql query so when we refer the query plan it tells the issue is due to partition of the db table. How to handle this?

0 Answers  


How to retrieve last two days updated records?

4 Answers  


Categories