BOOL_OR() GROUP BY ...
All functions > GROUP BY > BOOL_OR() GROUP BY ...
Returns TRUE if any value in the group is true.
Syntax
Diagram(
Sequence(
Terminal("BOOL_OR"),
Terminal("("),
NonTerminal("expr"),
Terminal(")"),
Choice(0, Skip(),
Sequence(
Terminal("FILTER"),
Terminal("("),
Terminal("WHERE"),
NonTerminal("condition"),
Terminal(")")
)
),
Choice(0, Skip(),
Sequence(
Terminal("GROUP BY"),
OneOrMore(NonTerminal("feature"), Terminal(","))
)
)
)
)| Parameter | Type | Required | Description |
|---|---|---|---|
expr | BOOLEAN | Yes | The boolean expression to evaluate |
condition | BOOLEAN | No | The condition to filter the values before aggregation |
feature | FEATURE | No | The features to group by (many features are supported) |
Notes
- Logical OR aggregation across all values in the group
- Returns TRUE if any value is TRUE
- Returns FALSE if all values are FALSE
- NULL values are ignored in the calculation
- Returns FALSE for empty groups
- Can be used with WHERE clause to filter before aggregation
- Can be used with GROUP BY clause for grouped aggregation
Examples
FeatureQL
SELECT
f1 := ZIP(ARRAY[TRUE, FALSE, TRUE] AS value).TRANSFORM(SELECT BOOL_OR(value)).UNWRAP_ONE(), -- OR of values
f2 := ZIP(ARRAY[FALSE, FALSE, FALSE] AS value).TRANSFORM(SELECT BOOL_OR(value)).UNWRAP_ONE() -- OR of values
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| TRUE | FALSE |