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...


suppose if we have dublicate records in a table temp n now
i want to pass unique values to t1 n dublicat values to t2
in single mapping using aggregator & router? how

Answers were Sorted based on User's Feedback



suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n du..

Answer / reddevilzzzz

@ Shalu
Your answer is almost correct. The question says, you have
to use Aggregator transformation.
Select all the rows from SQ.
Pass them to aggregator transformation. Group By on all
ports.
Create a Output port in Aggregator(lets call it TOTAL) and
give expression as COUNT(Col1).
Create a Router transformation, with 2 groups. In one group
(lets call it UNIQUE), put condition as TOTAL = 1.
In another group (lets call it DUPLICATES), put condition
as TOTAL>=2.
Pass the output from UNIQUE group to table where we want
unique rows.
Pass the output from DUPLICATE group to table where we want
duplicate rows.

P.S - tried and tested :):)

Is This Answer Correct ?    15 Yes 0 No

suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n du..

Answer / shalu

giving one example, lets say my table temp is having
following -

col1 col2
1 2
1 2
1 2
3 4
3 4
5 6

In the SQL Qualifier, override the query as
select col1,col2,count(1) total from temp group by col1,col2

which shows the output as
col1 col2 total
1 2 3
3 4 2
5 6 1

Now, use one router transformation where one condition is
where total >=1
and second condition where total>1

So first condition will return you all the unique records
1 2
3 4
5 6


and second condition will return you duplicate records
1 2
3 4

Is This Answer Correct ?    19 Yes 5 No

suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n du..

Answer / sankar

AS PER Reddevilzzzz ANS ALMOST OK

BUT NO NEED TO SELECT GROUP BY IN AGGREGATOR T/R BCOZ IF U
SELECT GROUP BY THERE IS NO DUPLICATE SO WITH OUT
DUPLICATES HOW WE PASS THE DUPLICATES IN T2.

Is This Answer Correct ?    1 Yes 1 No

suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n du..

Answer / hitesh

but in this we ll get distinct values in duplicate table.
how can i get all values in duplicate table like:
col1 col2
1 2
1 2
1 2
3 4
3 4
5 6
and i want
unique table:
5 6
and
duplicate table :
1 2
1 2
1 2
3 4
3 4

i know this is of no use, but can we do this??
pls rply

Is This Answer Correct ?    1 Yes 1 No

suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n du..

Answer / nikita jain

for this query we can use aggregator row wise calculation and handle then via router
col1 col2
1 2
1 2
1 2
3 4
3 4
5 6

O/P
Table with unique records:
1 2
3 4
5 6

Table with rest of the records
1 2
1 2
3 4

After SQ take a sorter transformation sort on col1 asc then an expression transformation
col1
col2
v_count iif(col1=prev_col1 and col2=prev_col2, vcount+1,1)
o_count v_count
prev_col1 col1
prev_col2 col2

Take a Router transformation , make 2 groups
Group1 : 0_count=1
Group2 : Default (it will come automatically)

Connect first group with unique target table
and second with other table

Is This Answer Correct ?    0 Yes 0 No

suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n du..

Answer / lokendra

wt ever above saying is correct.

Is This Answer Correct ?    0 Yes 9 No

suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n du..

Answer / srinu

I have a idea after sql transformation go thruogh 2 Agg
Trans,2 Router Trans
Agg1-gorup by col count=1 to router trans
Agg2-group by col count<>1 to router trans

I am not confident check itonce let me know,,

Thanks
Srinu

Is This Answer Correct ?    5 Yes 17 No

Post New Answer

More Informatica Interview Questions

why union transformation is active transformation?

6 Answers   IndiGo, TCS,


i have ten flat files with same structure,if i want to load it to single target,and mapping needs to should show only one source.what will be the steps to taken to achieve it?/

5 Answers   L&T,


How can a Lookup with Dynamic Cache be replaced in a mapping? Explain.

2 Answers   TCS,


i have a source table and 3 target table. when session runs first time-1st tgt second time-2nd tgt third time-3rd tgt fourth time-again 1st target. so no

4 Answers   HCL,


Hi, In a mapping I have 3 targets and one fixed width file as source. Total 193 records are there . I connected one port in aggregator to all 3 targets. The same value need to be load into these 3 targets . It is loaded like that only but in different order. Why? The order of insertion should be same know for all 3 targets ? Then why the order is changed ? Any one please help me. Advance thanks.

3 Answers   IBM,


CANNOT USE PARAMETER FILE! Hi all, I am trying to use parameter file for my workflow. This could help me to filter records where CITY = 'Portland' Following is what I have done: **in Designer - create new parameter : $$PARA_FIL, Parameter, String, IsExprVar=TRUE, Initial value = [empty] - Source Qualifier/ Properties/Source Filter: CUSTOMERS.CITY='$$PARA_FIL' **Create Parameter file: C:\Informatica\PowerCenter8.6.0 \server\infa_shared\BWParam\DynamicParamTest.txt $$PARA_FIL='Portland' **Configure workflow to use the parameter file: Edit Workflow/Properties/Parameter Filename: C:\Informatica\PowerCenter8.6.0 \server\infa_shared\BWParam\DynamicParamTest.txt I also configured directory of parameter file for session task. However, I just got this in the session log: [SQ_CUSTOMERS] SQL Query [SELECT CUSTOMERS.CUSTOMER_ID FROM CUSTOMERS WHERE CUSTOMERS.CITY='$$PARA_FIL'] No record has been loaded to target. It seems that the parameter file has not been read. I cannot understand the reason why. Could any of you kindly suggest me anything? Thanks

4 Answers   CSC,


we have a parameter file in Unix location where we have .txt files and those file will be used as source in informatica. I cannot use source file name directly as file name will keep on changing in unix location. I need to define $$InputFile as parameter. Can anybody send me the parameter file and the steps to handle this.

2 Answers   Infosys, TCS,


What is an expression transformation in informatica?

0 Answers  


Design time, run time. If you don't create parameter what will happen

0 Answers  


What are the basic needs to join two sources in a source qualifier?

4 Answers  


without update strategy how to insert &update?

1 Answers   DELL,


Which is costliest transformation? costly means occupying more memory?

3 Answers  


Categories