Apply filter in the right way such that the query and aggregations happen on filtered set