Remove Duplicates Range is not working correctly

I have duplicates in the “order_number” column of attached excel.When I use this(“Remove Duplicates Range”) activity it removes the duplicates but then assigns wrong order_num to increment_ID and sku.

image

After running the activity

image

image

Here “155” is wrongly assigned to different Increment_ID and SKU

what is the output you are expecting?

Include B and C column range also like A2:C5 delete previous output while running again

I want to remove duplicates of only column ‘A’ and I donot know the end range of the data.

Can you share the sample excel so that i can solve it and share the xaml

Use assign activity to assign removed duplicate rows of column ordered data
DT1 =olddatatable.DefaultView.ToTable(true,“order_number”).
Write DT1 to excel

1 Like

Mark as solved if it answers your question:

You need to perform it like this:
REMOVED_DATATABLE = ORIGINALDATATABLE.AsEnumerable().GroupBy(Function(a) a.Field(Of String)(“order_number”)).Select(Function(b) b.First).CopyToDataTable()

image

Guys…I can put different logics and resolve the requirement…I just raised this bug to Uipath that the activity isn’t solving the purpose !!!

1 Like

Hi Renuka, we have a feature scheduled for our next release that might resolve this. The new activity allows you to select the range and then lets you choose the columns to compare as duplicates.

1 Like

image
i am getting this error
this is my table
image
please help to resolve nadeem

Can you please share the code.

REMOVED_DATATABLE = ORIGINALDATATABLE.AsEnumerable().GroupBy(Function(a) a.Field(Of Double)(“order_number”)).Select(Function(b) b.First).CopyToDataTable()