Top  | Previous | Next

Advanced / sortDataset

sortDataset(dataset, keyColumn, [ascending])

Returns a new dataset based on the rows in the given dataset. Sort order is natural if the Class of keyColumn implements java.lang.Comparable, otherwise sorting is done by the toString() value.

 

sortDataset(dataset, 0, true)

... returns a Dataset sorted ascending on column 0.

 

sortDataset(dataset, "Column 1", false)

... returns a Dataset sorted descending on the column named "Column 1".