change alias of .as('name) from > to ~
since its precedes all other operators in grouping