Here, the 1st and 3rd row are duplicates. Is there any way to remove the duplicates based on the date & time? I need to keep the latest one and remove the other one.
Yes, time is different. I need to filter duplicates and also keep the latest one. This will keep the first occurrence and remove the remaining duplicates.
For now, can you try to put Remove DataRow activity just before the Assign activity as the following? Please set datatable variable and 0 at each property of the activity.
(From row In dt.DefaultView.ToTable(True,"Col1").AsEnumerable
Let a = dt.Select("[Col1]='"+row("Col1").ToString+"'").CopyToDataTable
Let b = a.AsEnumerable.OrderByDescending(Function(x) x("Col2").ToString).CopyToDataTable.Rows(0).ItemArray
Select dt2.Clone.Rows.Add(b)).CopyToDataTable