Want to remove duplicate rows from merged data table

Hi All,

Please help me out to remove duplicates from my merged data table where i want all my column but want to remove duplicate rows using 2 columns , columns are customerno, companycode.

I want to filter data further so want all columns as well.

Hi
Welcome back to uipath community
Did we try with REMOVE DUPLICATE Records activity

Or if you want to remove based on a particular column then use a assign activity like this
datatable = datatable.AsEnumerable().GroupBy(Function(a) a.Field(of string)(“yourcolumnname”).ToString).Select(Function(b) b.First()).CopyToDatatable()

Cheers @amruta_pawar

i tried with remove duplicate activity, can you tell me for 2 columns how to write?

@amruta_pawar
Give a try on
(From d in datatablevar.AsEnumerable()
Group d By cno= d(“Customerno”), ccode=d(“Companycode”) into grp=Group
Select grp.First()).CopyToDatatable()

dataTable new_dt =
old_dt.AsEnumerable().GroupBy(Function(i) i.Field(Of String)(“columnWithDuplicate”)).Select(Function(g) g.First).CopyToDataTable

Thank you so much for help , it really worked as expected. :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.