Modulo (mod, %%)
Adds a new column that returns the remainder of the division of the integer values in a field by another field or value.
Given the following example:
the Modulo operation calculates the remainder as follows, rounding down the result of the division (as can be done using the Floor (floor) operation):
The Division remainder (rem, %) operation also returns the remainder of a division, but instead rounds the result of the division to the nearest integer. Go to the operation article to learn more.
How does it work in the search window?
Select Create column in the search window toolbar, then select the Modulo operation. You need to specify two arguments:
The data type of the values in the new column is integer.
my.lookuplist.expenses table, we want to find the remainder of the division of the values in the budget column by 2.
The arguments needed to create the new column are:
- Dividend - budget column
- Divisor - Click the pencil icon and enter 2
Click Create column and you will see the following result:
How does it work in LINQ?
Use the operator
as... and add the operation syntax to create the new column. These are the valid formats of the Division remainder operation:
integer1 %% integer2
You can copy the following LINQ scripts and try the above example on the
my.lookuplist.expenses table. As said above, keep in mind that you must download and upload this lookup file to your Devo domain.
from my.lookuplist.expenses select budget %% 2 as `budget/2_mod`
from my.lookuplist.expenses select mod(budget, 2) as `budget/2_mod`