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


How we can get unique records into one target table and
duplicate records into another target table??

Answers were Sorted based on User's Feedback



How we can get unique records into one target table and duplicate records into another target table..

Answer / hunny

Try This :

Source -> SQ -> Sorter(Sort by Ascending on Key) -> Aggregator(Group by key Column,var=count(key colmn) - > Router(var = 1) -> Unique Target and (var > 1 ) -> Duplicates.

Make sure the Datatype for Var is not String in this scenario else will encounter operands of ambigious types mismatch error.

Is This Answer Correct ?    8 Yes 0 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / nag

Hi,

I think this scenario will help u.
Source - SQ Trans(2 Instances)-target(2 different targets)

In one of the Instances of SQ Trans write this Query:

select distinct <field name>......from <table name>;

Note:- It fetches only unique records.

In another Source instance write the following query:

select * from <table name> where rowid not in (select max
(rowid) from <table name> group by <field name>);
ex:- select * from emp where rowid not in (select max
(rowid) from emp group by ename);

Note:- It fetches only duplicate records.

then pass the fields to the targets(u should take different
targets).

I hope this will work.

Thanks and Regards,

Nag

Is This Answer Correct ?    10 Yes 3 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / usha

1st method by using expression transformation by adding
variable ports.


2nd method by using dynamicLKP we can load UNIQ records to
one taget table and DUPLICATE records to other target table

newLKProw=1(Insert)

newlkprow=0(if there is no difference in associate ports)
UNIQ records

Is This Answer Correct ?    10 Yes 3 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / chetan

I/p
A
B
B
C
D
D

need to load A.C in one tgt and B,B,D,D in another target table.

SQ o/p should be given to aggregator. group by first column.create another port(v_count) with count(*).

SQ o/p should be passed to joiner to join aggr and SQ(source).

o/p looks like after joinning
A 1
B 2
B 2
C 1
D 2
D 2

use router to route v_count=1 and v_count=2 to different targets.

Is This Answer Correct ?    7 Yes 0 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / naveen

Answer #3 is correct by Nag.

Addition to above second query for duplicate records, will
return unique records for each duplicate records.

if you need all duplicates records thn follow the below
query.

select * from emp
where empno in (select empno from emp group by empno having
count(empno)>1)


Regards,
Naveen

Is This Answer Correct ?    6 Yes 2 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / bala

in router count(*)=1 for good record

count(*)>1 for duplicate record

Is This Answer Correct ?    2 Yes 0 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / apoorva

question:

shouldn't the condition for unique_record be >= ??

Is This Answer Correct ?    1 Yes 0 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / haaris

If the source is RDMS, then you can write analytic function in the select statement to assign count to each row. And use this count column to route the records to respective target.

If the source is a flat (this is generally asked in interviews), then you can use aggregator to assign count to each row after grouping based on the key and use joiner to join back to source records that way all the rows coming from the SQ will have respective counts. Use router to route them to respective targets.

Is This Answer Correct ?    0 Yes 0 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / amedela chandra sekhar

sq-->Aggregator-->Router-->target

select group by for port name empno

in aggregater t/r take 1 output port and give condition like

select group by for port name empno

varcount---->count(*)



connect this one router and in router take 2 groups and
give condition like

uniqe_record :varcount=1-----for unique

duplicate_record :varcount>1 ----for duplicate


and connect that groups to target.

u will get result.

Is This Answer Correct ?    7 Yes 10 No

How we can get unique records into one target table and duplicate records into another target table..

Answer / chandra

FIRST WE TAKE SORTER Tr ,BY USING THIS WE CAN RETRIEVE
UNIQUE RECORDS...NEXT
WE TAKE EXP Tr IN THAT INSERT NEW OUTPUT PORT ..,IN THE
OUTPUT PORT EXPRESSION WRITE COUNT FUNCTION AFTER THAT TAKE
FILTER Tr IN THAT PUT THE CONDITION AS
IIF(COUNT>1,TRUE,FALSE)THEN CONNECT TO TARGET......


SQ-->SORTr-->TARTr1(UNIQUE)
-->EXPTr-->FIL Tr-->TAR Tr2(DUPLICATES)

Is This Answer Correct ?    17 Yes 30 No

Post New Answer

More Informatica Interview Questions

i have f;latfile source. i have two targets t1,t2. i want to load the odd no.of records into t1 and even no.of recordds into t2.

3 Answers   Wipro,


i have f;latfile source. i have two targets t1,t2. i want to load the odd no.of records into t1 and even no.of recordds into t2. what is the procedure and whar t/r's are involved and what is the mapping flow

4 Answers   Wipro,


What is meant by lookup transformation?

0 Answers  


I have a source as flat file and having data like ""TCS"MUMBAI" and i want output like TCS MUMBAI,the length of the data in the rows is variable.how can you fix it?

5 Answers   TCS,


Can we use different lookup tranformations for a same lookup table (lookup condition may or may not be same)with different output ports? How the cache files will be affected? Please clarify..

1 Answers  


Define joiner transformation?

0 Answers  


The structure of source file is as below: Source structure(two fields) Name, Card NUmber A, 111111111(SSN) A, 01010101(Creditcard number) A, 34343434(Debit card number) B, 55555555(Creditcard number) C, 77777777(Debit card number) Target Structure(4 fields) Name,Credit card,SSN,Debit card A,01010101,111111111, 34343434 B,55555555,, C,,,77777777 Corresponding to one name there can be maximum 3 rows and minimum zero rows. Given that I do not know which record might have a particular type of number. How can I handle above requirement with informatica transformations?

1 Answers   Amdocs,


What is a dimensional model?

0 Answers  


How do you take back up of repository?

0 Answers  


what type of problem you faced insales project or insurance project

1 Answers   Sony,


what is the monster dimension plz give me one example

2 Answers   EDS,


what is incremental loading ?

12 Answers   CTS, IBM, Oracle, TCS,


Categories