Filtering Between Duplicates

Hi,

FYI, another approach:

dt = dt.AsEnumerable.GroupBy(Function(r) Tuple.Create(r("ID").ToString,r("Name").ToString)).Select(Function(g) dt.Clone.LoadDataRow(g.OrderByDescending(Function(r) CInt(r("Level"))).ThenBy(Function(r) CDate(r("Date"))).First.ItemArray,False)).CopyToDataTable

Sample
Sample20240205-1.zip (9.9 KB)

Regards,

1 Like