How to filter result after groupby

Impossible to know exactly what’s going on without more information. But usually this sort of multiple filtering and aggregation operations requires blocks. I refer you to Dgraph’s tour of DQL, which covers this sort of operation: Query Variables | Blocksvars | Dgraph Tour