Skip to main content
Skip table of contents

MOD

Basic Overview

Description

Modulo function - Returns the remainder value after performing a division operation between two Nodes. The input values are ‘Number’, ‘Divisor’, as well as an optional validation option. If no validation is required, the same result can be achieved using the ‘%' symbol, e.g. ‘Number’ % 'Divisor’. The operation is performed along the linked levels between the Nodes.

Signature

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 effect performance.

    • The following values can be used: 

      • NoValidation: Behaves the same as using the '%' symbol. 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 (0,1,2,3).

Example

Inputs:

Node A

Year

Volume

2021

10

2022

10

2023

5

2024

0

2025

7

Node B

Year

Volume

2021

6

2022

10

2023

0

2024

5

2026

3

Results:

MOD(‘Node A’ , ‘Node B’ ) = MOD(‘Node A’ , ‘Node B’ , "NoValidation") = ‘Node A’ % ‘Node B’

Year

Result

2021

4

2022

0

2024

0

Note: The year 2023 has no result as it is not possible to perform ‘5 % 0’, e.g. divide by 0. While the years 2025 and 2026 have no result as there is no corresponding value in the other Node.

JavaScript errors detected

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

If this problem persists, please contact our support.