Comparisons & boolean logic
Overview
Comparisons and boolean (logical) operators turn numeric node values into conditions (true/false as 1/0). Use them to flag data and drive branching logic, most commonly inside IF(...).
Start here if…
You want to create a threshold.
You want to combine conditions.
You’re writing the condition part of
IF(condition, value_if_true, value_if_false).
What you’ll find on this page
A quick reference of comparison operators (like
>,=,!=) and what they return.A quick reference of boolean operators (AND / OR / NOT / XOR) and TRUE / FALSE helper functions.
How conditions are evaluated (0 vs non-zero) and how missing values can affect results.
Mental model
Comparisons compare matching rows and return 1 (true) or 0 (false).
Boolean operators combine or invert conditions and also return 1/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.
Operator reference
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 |
Syntax tip: Many comparisons can be written either as a function call or as an operator expression (for example GT('A','B') or 'A' > 'B').
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 thresholds:
('Margin' < 0) OR ('Revenue' = 0)Branching logic:
IF('Net Income' > 0, 'Net Income' * 'PayoutRate', 0)Truthiness shortcut (0 vs non-zero):
IF(‘Delta’, 1, 0)treats any non-zero Delta as true (including negatives).Always take
'A'where a node is defined:IF(TRUE('Sales'), 'A', 'B')Find missing intersections:
IS_NA('Sales')(returns 1 where values are undefined)
Pitfalls & troubleshooting
Truthiness surprises: In conditions,
0is false and any non-zero is true, so “boolean” inputs don’t need to be strictly 0/1.Undefined values: Comparisons can treat undefined values as false.
TRUE/FALSE only cover defined rows:
TRUE('Node')andFALSE('Node')apply only where'Node'is defined. If you need a flag for undefined rows, useIS_NA('Node').Cube size risk:
IS_NAreturns a fully expanded cube and can hit maximum cube size.Dimensional mismatch: Some boolean functions (for example
XOR) have strict dimensionality constraints that can exclude inputs or produce unexpected results when granularities differ.
Related sections
Operators overview + navigation to arithmetic vs comparisons/boolean logic.
IF (Logical functions): how conditions are interpreted and how branching works.
Formula basics parentheses, evaluation order, and quoting rules for node references.
Troubleshooting guide diagnose wrong shape vs wrong numbers vs empty output (especially around missing values).