Reference Updated April 10, 2026

SUBTRACTION (-)

Category: Arithmetic operators

Overview

The SUBTRACTION operator subtracts one input from another after aligning both inputs to their common dimensions. In other words, subtraction uses the intersection of the shared dimensions.

The result keeps the coarser level in each shared dimension. Dimensions that exist on only one side are aggregated away.

Use this operator to calculate differences between two nodes.

Syntax

'Node1' - 'Node2'

Example usage: 'Revenue' - 'OPEX'

Parameters

ParameterDescriptionTypeRequired
Node1Minuend node, specified using the node name in single quotes (e.g.'Revenue')Node referenceYes
Node2Subtrahend node, specified using the node name in single quotes (e.g.'OPEX')Node referenceYes

Output Shape

AspectBehavior
DimensionalityBoth inputs are aggregated to their common dimensions (the intersection of the shared dimensions). Per shared dimension, the coarser level is used. Dimensions that exist on only one side are aggregated away.
Level valuesNon-matching level values are preserved in the result.
Row countEqual or reduced, depending on how much aggregation is required before subtracting.

Watch Out

  • Subtraction uses the common dimensions (intersection), just like addition.
  • Dimensions that exist on only one side are aggregated away before subtracting.
  • When subtracting a constant such as 'Revenue' - 100, the node is aggregated first and the constant is then subtracted from the total.
  • We recommend storing costs as negative values where possible, so addition can be used consistently throughout the model.
  • Both sides must have the same unit, unless one side is a scalar value.

Examples

Subtracting nodes with matching dimensions

Input node: Revenue

YearValue
2025500
2026600
2027550

Input node: Cost

YearValue
2025300
2026350
2027400

Formula: 'Revenue' - 'Cost'

Year-> SUBTRACTION Result
2025500 - 300 = 200
2026600 - 350 = 250
2027550 - 400 = 150

Subtracting nodes with different level values

When level values do not overlap, subtraction preserves both values in the result. The value from the second input appears as negative.

Input node: A

YearValue
2025100

Input node: B

YearValue
202640

Formula: 'A' - 'B'

Year-> SUBTRACTION Result
2025100
2026-40

Subtracting nodes with different dimensionality

This example shows how subtraction aggregates Node B to the common dimensions before subtracting it from Node A.

Input node: Node A

YearValue
20255
202610

Input node: Node B

YearProductValue
2025A2
2026A3
2026B4

Formula: 'Node A' - 'Node B'

Year→ SUBTRACTION Result
20255-2 = 3
202610-(3+4) = 3

FunctionWhen to use instead
ADDITION (+)When you want to combine values across the same shared-level alignment logic but add them instead of subtracting them.
MULTIPLICATION (*)When you want to multiply values instead of subtracting them.
Was this page helpful?