I have a query using stateCount where I would really like to group the output based upon a change of state. There does not seem to be anything available that would let me do this.
It occurs to me that if you added a new function (partition say) that accepted two parameters, current and previous record, then returned true if they belong in the same group, you could partition data into groups using arbitrary logic. Obviously the first record in a table would always be in a new group so you only call the function for second and subsequent records in a table. Something like this:
|> stateCount(fn: (r) => r.data >= 500, column: "over")
|> partition(fn: (r, p) => r.over == p.over + 1)