Put 'reduction' at the end in groupBy query

Related to #11