I want to remove duplicate based on specific column

Hi
I have excel sheet i want to remove duplicate based on specific column
• Remove duplicates based on the “Main Transaction” column, the priority is based on the “Start Transaction Time” column. keep the newer transactions

Hi @Muneer_Alrashdan1 ,

Try this syntax

Yourdt.DefaultView.ToTable(True,“Your colum name”)

This is only filter your given column and you get the result only that column data’s

Hi,

Can you try the following expression with Assign activity?

dt = dt.AsEnumerable.GroupBy(Function(r) r("Main Transaction").ToString).Select(Function(g) g.OrderBy(Function(r) CDate(r("Start Transaction Time").ToString)).Last()).CopyToDataTable()

Regards,

1 Like

Hi @Muneer_Alrashdan1,
Use below code to get unique value of the column

(From p in dt.Select() where( From q in dt.Select() where q("Main Transaction").Equals(p("Main Transaction")) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()

Regards,
Arivu

Hi @Muneer_Alrashdan1 ,

Take a look this !!!

Regards
Balamurugan.S