if (sortIndex < 0 || sortIndex == pivotColumn) index.sortByValue(distinctValues, sortOrder);
else index.sortByScalar(distinctValues, functionCodes[sortIndex], columns[sortIndex], sortOrder);
}
// Build the label interval set from the sorted list of distinct values.
LabelDomain _pivotDomain = (LabelDomain) _pivotProp.getDomain();
List<Interval> intervals = _pivotDomain.getIntervals(distinctValues);
// Populate the dataset with the calculations.
for (int j=0; j<columns.length; j++) {
DataProperty dataProp = getPropertyByColumn(columns[j]);