Reference Updated April 8, 2026

XOR

Category: Logical functions

Overview

Description

Connects two inputs with the logical ‘exclusive or’ XOR and returns true (1) if exactly one of the input values is true and false (0) otherwise.

Use when you need a 1/0 flag that becomes true only if exactly one of two inputs is true.

Syntax

`XOR('Node1', 'Node2')`

Parameters

  • Node1: First input node, specified using the node name in single quotes (e.g. 'Profit').

  • Node2: Second input node.

Limitations

Both input nodes must have the same dimensionality; otherwise rows are excluded from the function output.


Examples

Typical use

This example shows that XOR returns 1 only when exactly one input is true. If both inputs are true or both are false, the result is 0.

Input node: A

YearValue
202517
20260
20270
20281

Input node: B

YearValue
20251
20260
20271500
20280

Formula: XOR('A', 'B')

Year→ XOR Result
20250
20260
20271
20281

Limitations

Both input nodes must contain the same levels, otherwise the function will consider only the more granular function while ignoring the function with fewer levels.

image-20220511-130750.png

Example of the limitation: The function is given two EXPANDSINGLE() inputs. However, one of the EXPANDSINGLE() functions possesses more levels than the other, resulting in different granularity. The function with more levels is the leading function. This leads to unexpected outputs from the XOR() function.


FunctionWhen to use instead
[OR (
AND (&&)When both inputs must be true at the same time instead of exactly one of them.
Was this page helpful?