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
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 |
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 |
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 |
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 |
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 |
how u know when to use a static cache and dynamic cache in lookup transformation.
i have a table like empid ename year month sal 1 x 98 jan 500 1 x 98 feb 500 1 x 98 mar 500 1 x 99 jan 600 1 x 99 feb 600 2 y 98 jan 600 2 y 98 feb 600 2 y 98 mar 600 2 y 99 jan 700 2 y 99 jan 700 and so on i want to find out totsal for every emp on year wise plz help me
pmscmd startworkflow -sv <host name> -d <domain name> -u <user name> -p <password> -f <folder name> <workflow name> while running this command I got the error as "no gateway connectivity is provided for your domain name". So anyone please help me how to rectify this error?
in my source table one of column contains the data like vishnraju@gmail.com,suresh@yahoo.com,krishna@hotmail.com these records i need to send in target table as below format. vishnuraju,suresh,krishna
hi friends ... i have insurance project(informatica),can you please tell me how many table and mappings we need to use?and explain me.. thank you
HOW TO DELETE A RECORD FROM FLAT FILE
what is the difference between lookupoveride and joiner?
How to load the data into target table, which not have Primary/Surrogate key (Duplicate records not acceptable)
why cant we put a sequence generator or upd strategy transformation before joiner transformation?
what are the limitation of sorter transformation?
What are the transformations that cannot be placed between the sort origin and the joiner transformation so that we do not lose the input sort order?
What are the issues you have faced in your project? How did you overcome those issues?