GroupByKey[datatable,f]returns a DataTable in which the rows in in the input data table have been grouped into sublists with distinct f[row key (ID)].
Define some data:
Group the rows based on the first 4 characters in the row key:
DataTable GroupBy