Performs multistage aggregation of multi-dimensional counts