Is anyone familiar with Remove Duplicate Rows (from the DataTable Activities)? I am pulling a large data table from SharePoint but I want to delete rows that have the same code in a certain column. So for example I have 5 columns in my data table and a lot of rows. I want to delete duplicates that that are contained in one of the columns. Does that make sense? Can anyone help?
Thanks for the response but I don’t want to delete entire columns I just want to delete entire rows where the same code is found in ‘Column 1’. Does that make sense?
OK. I see that it won’t delete the entire columns but it doesn’t seem to work for me. The problem is (i think) that the entire row is not a duplicate. There are duplicates in ‘column 1’. I want to delete the entire row if there are duplicate codes in ‘column 1’ even though column 2,3,4 etc may not be duplicate. So in the screen shot below I want to get rid of test 2 and test 3 (the entire rows) but keep test 1 in the data table
Hi
this expression could help you with datatable = datatable.AsEnumerable().GroupBy(Function(a) a.Field(of string)(“yourcolumnnname”).ToString).Select(Function(b) b.First()).CopyToDatatable()
if you are not getting asenumberable then kindly have a view on this thread