How do we eliminate duplicate records in a flat file without using Sorter and Aggregator?
Answer Posted / priyank
There are several ways of achieving this. We can do it
through expression transformation and other is look up on
the target.
Expression transformation:
Create ports,
Var_PREV_KEY=Key
Var_CURR_KEY=Var_PREV_KEY
Var_CHK_DUPLICATE --> IIF(Var_CURR_KEY=Key,'DUP','NODUP')
OUT_DUPLICATE --> Var_CHK_DUPLICATE
Note: I have taken a scenario where the target table
contains only 1 Key. In case of multiple keys, will have to
create a few more Variable ports for both CURR and PREV and
in the Var_CHK_DUPLICATE port, we need to add those checks
with an 'AND' operator.E.g. For 2 keys,
Var_PREV_KEY1=Key1
Var_CURR_KEY1=Var_PREV_KEY1
Var_PREV_KEY2=Key2
Var_CURR_KEY2=Var_PREV_KEY2
Var_CHK_DUPLICATE --> IIF(Var_CURR_KEY1=Key1 AND
Var_CURR_KEY2=Key2,'DUP','NODUP')
OUT_DUPLICATE --> Var_CHK_DUPLICATE
If the Informatica version is Unix installation, then in
the pre session command you can give an unix command to
remove the duplicates from the file like
sort <file_name> | uniq > <file_name>.new
Hope it helps.
| Is This Answer Correct ? | 4 Yes | 12 No |
Post New Answer View All Answers
Design a mapping to get the pervious row salary for the current row. If there is no pervious row exists for the current row, then the pervious row salary should be displayed as null.
What are the new features of informatica 9.x at the developer level?
How to create or import flat file definition in to the warehouse designer?
How can we delete duplicate rows from flat files?
Hi Everybody, I have one fixed width file as source and 4 oracle tables (relational) as target. What are the Unit test cases i need to implement ? 1.Using TextPad software i tested postion of the field 2.As per specification i tested like whether it is correctly mapped or not? Is there any other test case do i need to implement. If possible can any one give me the test cases Advance Thanks
How will the document be delivered to me?
How to update a particular record in target with out running whole workflow?
What is the fact table?
scenario where i can use only concurrent execution of workflow.
How an expression transformation differs from aggregator transformation?
Dimension Object created in Oracle can be imported in Designer Cubes contain measures
What are active and passive transformations?
What are mapplets?
What are the informatica performance improvement tips
What is the difference between SOURCE and TARGET BASED COMMITS? What are the deliverables?in your project?