group_by_keys function

Group table instances by keys aggregating the measures using the corresponding aggregation function.