sumArray
Description
The ForEach combinator
can be applied to the sum aggregate function to turn it from an aggregate
function which operates on tables to an aggregate function which operates on
an array.
Example Usage
For this example we'll make use of the hits dataset available in our SQL playground.
The hits table contains a column called isMobile of type UInt8 which can be
0 for Desktop or 1 for mobile:
We'll use the sumForEach aggregate combinator function to analyze how
desktop versus mobile traffic varies by hour of the day. Click the play button
below to run the query interactively:
