Comparisons & boolean operators
Overview
Comparisons and boolean operators turn values into conditions. Use them to test values, combine conditions, and drive branching logic, most commonly inside IF(...).
They return 1 for true and 0 for false.
Start here if…
You want to write a condition such as
'Revenue' > 1000You want to combine conditions with
AND,OR,NOT,XORYou need a
TRUE/FALSEhelper functionYou’re writing the condition part of
IF(condition, value_if_true, value_if_false).
Not here if…
You are searching the catalog for a function page by name such as
GT,EQ,AND, orIS_NA→ see Logical functionsYou want branching behavior and examples for
IF(...)specifically → see IF
Mental model
Comparisons compare matching rows and return 1 (true) or 0 (false).
Boolean operators combine or invert conditions and also return 1 or 0.
TRUE('Node')/FALSE('Node')returns 1/0 wherever'Node'is defined.IS_NA('Node')returns 1 where'Node'is undefined (and can expand result size).In
IF(...), 0 is interpreted as false and any other value as true.
Comparison operators
Operator | Function equivalent | Details | Returns 1 when… |
|---|---|---|---|
|
| values are equal | |
|
| values are not equal | |
|
| left is greater than right | |
|
| left is greater than or equal to right | |
|
| left is less than right | |
|
| left is less than or equal to right |
Many comparisons can be written either as a function call or as an operator expression, for example GT('Node1', 'Node2') or 'Node1' > 'Node2'.
Boolean operators
Operator | Function equivalent | Details | Returns 1 when… |
|---|---|---|---|
|
| both inputs are true | |
|
| at least one input is true | |
|
| input is false (0) | |
|
| exactly one input is true |
These operators are most commonly used inside IF(...) conditions.
Defined/undefined helper functions
Function | Details | Returns |
|---|---|---|
| 1 on defined intersections | |
| 0 on defined intersections | |
| 1 on undefined intersections |
Common patterns
Flag positive values:
'Value' > 0Combine conditions:
('Margin' < 0) OR ('Revenue' = 0)Branching logic:
IF('Net Income' > 0, 'Net Income' * 'PayoutRate', 0)Truthiness shortcut:
IF('Delta', 1, 0)treats any non-zero value as true.Check whether a node is defined:
IF(TRUE('Sales'), 'Node1', 'Node2')Find missing intersections:
IS_NA('Sales')
Pitfalls & troubleshooting
Truthiness surprises: in conditions,
0is false and any non-zero value is trueDefined vs undefined:
TRUE('Node')andFALSE('Node')apply where the node is defined; useIS_NA('Node')to detect undefined intersectionsCube size risk:
IS_NA(...)can expand result size significantlyDimensional mismatch: some logical functions, such as
XOR, may behave unexpectedly when inputs differ in granularity
Related sections
IF: how conditions are interpreted in
IF(...)Formula basics: parentheses, evaluation order, and quoting rules
Troubleshooting guide: wrong shape, wrong numbers, empty output, and missing values