Must be analog to Average code
Merge pull request #1324 from trob/j3_groupbySum

Must be analog to Average code