Skip to main content

MOD

The MOD function is used to calculate the modulo of a number. The modulo is the remainder when one number is divided by another.

The function takes two arguments: the number to be divided (the "value") and the divisor (the "mod"). The first argument, value, is the number to be divided. It can be an integer value or an integer column in a Data Sync project.

The second argument, mod, is the divisor to be used in the calculation. It must be a non-zero integer value.

The function returns the remainder when value is divided by mod.

Syntax

int? MOD(int? value, int mod)

Example

Here is an example of using the MOD function in a Data Sync project on the column Quantity:

MOD("Quantity", 2)

In this example, the MOD function is used to calculate the remainder when the Quantity column is divided by 2.

This can be useful for determining if a number is even or odd. If the result is 0, the quantity is even. If the result is 1, the quantity is odd.