for (int i=0; i< groupFunctions.size(); i++) {
GroupFunction groupFunction = groupFunctions.get(i);
result.addColumn(groupFunction.getColumnId(), ColumnType.NUMBER);
DataColumn dataColumn = dataSet.getColumnById(groupFunction.getSourceId());
if (dataColumn == null) dataColumn = dataSet.getColumnByIndex(0);
Double aggValue = _calculateFunction(dataColumn, groupFunction.getFunction(), index);
result.setValueAt(0, i, aggValue);
}