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, colIndex[, ascending])

  • Parameters

DataSet dataset - The starting dataset.

int colIndex - The index of the column to sort on.

Bool ascending - Optional. A flag indicating whether or not to sort ascending.

  • Results

DataSet - A sorted dataset


 sortDataset(dataset, colName[, ascending])

  • Parameters

DataSet dataset - The starting dataset.

int colName- The name of the column to sort on.

Bool ascending - Optional. A flag indicating whether or not to sort ascending.

  • Results

DataSet - A sorted dataset



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".