When using aggregation, additional fields should not be included in the grouping function