BOOL_AND

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns true if all input values are true; otherwise returns false.

Syntax 

1bool_and(<expression>)

Arguments 

Required 

  • <expression>: An expression of type boolean.

Returns 

Returns a boolean value. Returns NULL if no rows are selected.

Considerations 

  • NULL values are ignored in the calculation.
  • Equivalent to the EVERY function.

Examples 

Check All True 

Check if all orders are shipped.

1SELECT bool_and(is_shipped) AS all_shipped
2FROM orders
3WHERE order_date = '2024-01-15';

Validate by Group 

Check conditions for each group.

1SELECT department, bool_and(is_active) AS all_active
2FROM employees
3GROUP BY department;

Related Documentation