MOD
Category: Math & numeric
Overview
Description | Modulo function. Returns the remainder value after performing a division operation between two nodes. The input values are Use when you need the remainder after dividing one value by another, for example for bucket logic or periodic patterns. |
Syntax |
|
Parameters |
|
Note | For this operation, the result of the division only returns whole numbers such as |
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
| Year | Volume |
|---|---|
| 2025 | 10 |
| 2026 | 10 |
| 2027 | 5 |
| 2028 | 0 |
| 2029 | 7 |
Input node: Node B
| Year | Volume |
|---|---|
| 2025 | 6 |
| 2026 | 10 |
| 2027 | 0 |
| 2028 | 5 |
| 2030 | 3 |
Formula: MOD('Node A', 'Node B') = MOD('Node A', 'Node B', "NoValidation") = 'Node A' % 'Node B'
| Year | → MOD Result |
|---|---|
| 2025 | 4 |
| 2026 | 0 |
| 2028 | 0 |
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.
Related Functions
| Function | When to use instead |
|---|---|
| DIVISION (/) | When you need the quotient of a division instead of the remainder after division. |
| ROUND | When you want to round numeric values instead of calculating a remainder. |