cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate records

praveenreddy_bk
Participant
0 Kudos

Hi, Need a code to remove Duplicate records in java .

Accepted Solutions (0)

Answers (1)

Answers (1)

justin_santhanam
Active Contributor
0 Kudos

Praveen,

Could u give an example? You can do it in Graphical Mapping!

raj.

praveenreddy_bk
Participant
0 Kudos

for example:

IF I am sending Id frm the source side and the same ID is mapped to the target side .

justin_santhanam
Active Contributor
0 Kudos

Praveen,

Duplicate records and the example which u said is totally contradicting! Are u looking for something like below

Source

<Records>

<Row>

<ID>10001</ID>

<Name>Praveen</Name>

</Row>

<Row>

<ID>11901</ID>

<Name>Raj</Name>

</Row>

<Row>

<ID>10001</ID>

<Name>Praveen</Name>

</Row>

</Records>

Target

<Records>

<Row>

<ID>10001</ID>

<Name>Praveen</Name>

</Row>

<Row>

<ID>11901</ID>

<Name>Raj</Name>

</Row>

</Records>

Since ID 10001 Duplicated twice, you need to remove one! Is my understanding correct, regarding ur reqmt?

raj.

praveenreddy_bk
Participant
0 Kudos

Yes frnd,

Thanks for understanding my problem .I need code in java .

justin_santhanam
Active Contributor
0 Kudos

Dear Praveen,

Try the below logic and let me know if it helps!


Records -----> Records
 
ID[Change Context]------>Sort[Choose Numerical,Ascending]------> SplitByValue[Value Change]-----> Collapse Context--------->Row

*To Populate, Target ID Field*
ID[Change Context]------>Sort[Choose Numerical,Ascending]------> SplitByValue[Value Change]-----> Collapse Context--------->SplitByValue[Each Value]----->ID
 

*To Populate, Target Name Field*

ID[Change Context]------>Sort[Choose Numerical,Ascending]------> SplitByValue[Value Change]-----> 1

ID[Change Context] & Name[Change Context]------>Sort By Key[Choose Numerical,Ascending]------> 2
 
1 & 2 -------->Format By Example ---------->CollapseContext----------->SplitByValue[Each Value]-------->Name

In the second logic, while populating Name field,

Format ByExample expects two input . In the above logic consider 1 & 2 as continuation. Hence Format By Example first input must be 1(ie continutation) and the second input must be 2(ie continuation).

If you think it's confusing, then let me know.

raj.