aggregation should sort groups by a filtered metric