PRODUCT() GROUP BY ...
All functions > GROUP BY > PRODUCT() GROUP BY ...
Returns the product of the numeric values in the group.
Syntax
PRODUCT(expr) [ FILTER (WHERE condition) ] [ GROUP BY feature [, feature ...] ]
Notes
- NULL values are ignored where the underlying aggregate skips NULLs
- Can be used with FILTER (WHERE condition) and GROUP BY like other aggregates
Examples
FeatureQL
SELECT
-- Product over one group
f1 := ZIP(ARRAY(1, 1, 1) AS g, ARRAY(2, 3, 4) AS v).TRANSFORM(
SELECT PRODUCT(v) GROUP BY g
).UNWRAP_ONE()
;Result
| f1 BIGINT |
|---|
| 24 |