Thanks for the answer.
Lets hope that we get an option in future where we can specify some kind of aggregate function (avg, count, min, max, sum, first, last, random) where every tag can be used and the whole expression language where only the group-by-tag can be used (to force a specific result per group).
Should not be that difficult to implement, since all this functions map directly to standard sql functionality.