use filtered query insead of aggregation filter when using WHERE and GROUP BY