apply the aggregations after first round of filtering.