Skip to main content
Skip table of contents

Logical functions

Overview

Use this category when you need conditions, comparisons, and branching logic in formulas. Logical functions help you build boolean-style expressions (typically represented as 1/0) and use them to select values (for example with IF(...) or to create flags for validation and analysis.

Start here if…

  • You want to build a condition (thresholds, flags, rules).

  • You want branching logic (if/else).

  • You want to combine conditions.

  • You want to detect missing/undefined values.

Not here if…

  • You want comparison operators and boolean keywords as operators (for example >, =, AND, OR, NOT) → see Operators

  • You want to filter a dataset to a subset of members → see Filtering & data shaping

  • You want numeric transformations (rounding, abs, min/max) → see Math & numeric


Mental model

  • Logical functions usually produce 1 (true) or 0 (false) across the same dimensionality as their inputs.

  • Conditions are most commonly used inside IF to select between two results.

  • Missing values can affect conditions; use IS_NA to create a diagnostic flag when results look unexpectedly empty or incomplete.


Common patterns

  • Apply a business rule (if/else)IF('Margin' < 0, 0, 'Margin')
    Use to cap, floor, or branch values based on a condition.

  • Create a threshold flagGT('Revenue', 100000)
    Use to mark where values exceed a threshold (returns 1/0).

  • Compare two nodes for equalityEQ('Actuals', 'Plan')
    Use to create match/mismatch flags for validation.

  • Combine multiple conditionsAND(GT('Node', 0), LT('Node', 10))
    Use to build “between” rules or multi-part checks.

  • Invert a conditionNOT(EQ('Status', 1))
    Use when you want the opposite of an existing rule.

  • Check for missing/undefined valuesIS_NA('Node')
    Use to identify where values are undefined and may affect downstream comparisons.


Functions in this category

Function

Description

IF

Returns one result when a condition is true and another result when it is false.

EQ (=)

Returns 1 where matching values are equal; otherwise returns 0.

NEQ (!=)

Returns 1 where matching values are not equal; otherwise returns 0.

GT (>)

Returns 1 where the first input is greater than the second; otherwise returns 0.

GTE (>=)

Returns 1 where the first input is greater than or equal to the second; otherwise returns 0.

LT (<)

Returns 1 where the first input is less than the second; otherwise returns 0.

LTE (<=)

Returns 1 where the first input is less than or equal to the second; otherwise returns 0.

AND

Returns 1 when both inputs are true; otherwise returns 0.

OR

Returns 1 when at least one input is true; otherwise returns 0.

NOT

Inverts logical values so non-zero becomes 0 and zero becomes 1.

XOR

Returns 1 when exactly one input is true; otherwise returns 0.

TRUE

Returns 1 for every defined value in the input node.

FALSE

Returns 0 for every defined value in the input node.

IS_NA

Returns 1 where values are undefined in the input node’s dimensionality; otherwise returns 0.


Choosing between similar functions

  • IF vs flags (EQ/GT/LT/…)

    • Use EQ/GT/LT/… when you need a flag (1/0) for validation, filtering, or diagnostics.

    • Use IF when you want to return values (choose between two results).

  • EQ vs NEQ

    • Use EQ to mark matches.

    • Use NEQ to mark mismatches.

  • GT/GTE vs LT/LTE

    • Use GT/GTE for “above threshold” rules.

    • Use LT/LTE for “below threshold” rules.

  • AND/OR vs XOR

    • Use AND when all conditions must hold.

    • Use OR when any condition may hold.

    • Use XOR when exactly one condition should hold.

  • IS_NA vs FALSE/TRUE

    • Use IS_NA to detect undefined values in real data.

    • Use TRUE/FALSE when you need a constant condition across all defined intersections.


Pitfalls & troubleshooting

  • IF result looks incomplete: check whether the condition is undefined for some intersections; use IS_NA to spot where inputs are missing.

  • Cube size risk: IS_NA expands to a fully expanded cube and can hit maximum cube size.

  • Conditions “look wrong”: spot-check both operands at the same intersection in Data preview (the root cause is often upstream values, not the comparison).

  • Multi-part logic is hard to debug: split logic into helper nodes (one condition per node), then combine with AND / OR.

  • Between logic: make it explicit with AND(GTE(...), LTE(...)) rather than relying on a single comparison.

  • Missing vs zero confusion: review Troubleshooting guide (missing value behavior).


Related sections

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.