any_not_null

any_not_null(expression: storable) -> expression

Aggregate and window function like any, but configured to ignore null input values when selecting a representative. If every input in the group (or frame) is null, the aggregate result is null. For nested array or object inputs the lowering uses casts through variant internally so a non-null value can still be returned.

Domain

This is an aggregate function (aggregates rows over a group in aggregate verbs).

This is a window function (calculates over a group of multiple input rows using windowing).

Categories

Examples

statsby first_host:any_not_null(hostname), group_by(region)

Returns some non-null hostname from each region if any exist, using any_not_null instead of surfacing null picks.