Added aggregation by user-provided key