Skip to main content
Skip table of contents

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

Parameter

Description

Type

Required

Node1

Minuend node, specified using the node name in single quotes (e.g.'Revenue')

Node reference

Yes

Node2

Subtrahend node, specified using the node name in single quotes (e.g.'OPEX')

Node reference

Yes

Output Shape

Aspect

Behavior

Dimensionality

Both 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 values

Non-matching level values are preserved in the result.

Row count

Equal 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

Year

Value

2025

500

2026

600

2027

550

Input node: Cost

Year

Value

2025

300

2026

350

2027

400

Formula: 'Revenue' - 'Cost'

Year

-> SUBTRACTION Result

2025

500 - 300 = 200

2026

600 - 350 = 250

2027

550 - 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

Year

Value

2025

100

Input node: B

Year

Value

2026

40

Formula: 'A' - 'B'

Year

-> SUBTRACTION Result

2025

100

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

Year

Value

2025

5

2026

10

Input node: Node B

Year

Product

Value

2025

A

2

2026

A

3

2026

B

4

Formula: 'Node A' - 'Node B'

Year

→ SUBTRACTION Result

2025

5-2 = 3

2026

10-(3+4) = 3


Related Functions

Function

When 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.

JavaScript errors detected

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

If this problem persists, please contact our support.