Find newest date in Datatable from itemnumbers


In Excel I would use a matrix formula and a max value, but how is it done in Uipath

I need to find the newest date in a datatable with several entries on item numbers

90000035 27-10-2014 957
90001856 27-06-2011 960
90001856 21-12-2015 975
90001856 18-03-2016 970
90019693 14-03-2016 1015
90019693 12-12-2015 1010

The three lines I’m trying to keep is the ones marked in bold.
They are the newest unique ones in the dt.


Can you try the following sample?


dt = dt.AsEnumerable.GroupBy(Function(r) r(0).ToString).Select(Function(g) g.OrderBy(Function(r) DateTime.ParseExact(r(1).ToString,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture)).Last()).CopyToDataTable() (8.8 KB)


dt.Select("",[Date] desc").CopyToDataTable()



Yoichi’s solution worked very fine, so haven’t checked the other proposal.

Thanks both for your time and help. Extremely appreciated.

Best regards

1 Like

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