Reference Updated March 25, 2026

MOD

Category: Math & numeric

Overview

Description

Modulo function. Returns the remainder value after performing a division operation between two nodes. The input values are 'Number', 'Divisor', and an optional validation option. If no validation is required, the same result can be achieved using the % symbol, for example 'Number' % 'Divisor'. The operation is performed along the linked levels between the nodes.

Use when you need the remainder after dividing one value by another, for example for bucket logic or periodic patterns.

Syntax

MOD('Number', 'Divisor' [, "Validation"])

Parameters

  • Number: Input node.

  • Divisor: Input node.

  • Validation (optional): Causes the node executing the function to error with a message explaining why if conditions are not met. Note that using validation can affect performance. The following values can be used:

    • “NoValidation”: Behaves the same as using the % symbol. This is the default option if no validation is specified.

    • ”FailOnMissingFirst”: The calculation fails if any row in ‘Number’ is not matched with any row in ‘Divisor’.

    • ”FailOnMissingSecond”: The calculation fails if any row in ‘Divisor’ is not matched with any row in ‘Number’.

    • ”FailOnMissing”: Combines “FailOnMissingFirst” and FailOnMissingSecond” validation options.

Note

For this operation, the result of the division only returns whole numbers such as 0, 1, 2, or 3.


Examples

Modulo with missing matches and division by zero

This example shows how MOD behaves when rows are matched normally, when a divisor is zero, and when rows are missing on one side.

Input node: Node A

YearVolume
202510
202610
20275
20280
20297

Input node: Node B

YearVolume
20256
202610
20270
20285
20303

Formula: MOD('Node A', 'Node B') = MOD('Node A', 'Node B', "NoValidation") = 'Node A' % 'Node B'

Year→ MOD Result
20254
20260
20280

Note: The year 2027 has no result because it is not possible to perform 5 % 0, that is, divide by 0. The years 2029 and 2030 have no result because there is no corresponding value in the other node.


FunctionWhen to use instead
DIVISION (/)When you need the quotient of a division instead of the remainder after division.
ROUNDWhen you want to round numeric values instead of calculating a remainder.
Was this page helpful?