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
-- Product over one group
RETURN
    f1 := ZIP(ARRAY(1, 1, 1) AS g, ARRAY(2, 3, 4) AS v).TRANSFORM(
        DEFINE
            p := PRODUCT(v) GROUP BY (g)
        RETURN p
    ).UNWRAP_ONE()
;
Result
f1 BIGINT
24