Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What are the components of Informatica? And what is the purpose of each?

0 Answers   Informatica,


What is different between informatica version 8 and 9 version

1 Answers   Cognizant, IBM,


If we have lookup table in workflow how do you trouble shhot to increase performance?

2 Answers  


write asql query to filter improper date format? date 20-apr 11-mar-2010 30-may-2010 feb-2009 i want the output date 11-mar-2010 30-may-2010

2 Answers   Accenture,


How to do Half of the table ex: if 1000 records are there means 500 in one table and 500 in second table like this if N number of tables means how to do Half of the table ??????????

2 Answers   TCS,


if i have a delimited file as source so how can we seperate this file into three diff targets?

2 Answers   TCS,


What are the designer tools for creating transformations?

0 Answers   Informatica,


Normalizer transformation is not involved in Mapplet.. why???

1 Answers   Wipro,


If a workflow stops or fails after loading 10k records ? How can you recover it and If there is no order while reading data from source ?

2 Answers   IBM, WalMart,


Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal A 10; B 20; C 30; Total 60; Use SQL For this scenario

4 Answers   TCS, Wipro,


Howmany ways yoU can update a relational source defintion and what are they?

1 Answers  


How to calculate the cache size if say we are doing a performance check on a mapping and found that a particular cache needs to be changed. Is there a formula to calculate this! i know that informatica has a auto option available but how to calculate manually?

1 Answers  


Categories