Modulo Defined
The Modulo operation determines the remainder of division of one number by a second number. Example: 9 MOD 2 evaluates to 1 because 9 divided by 2 is 4 with a remainder of 1. Modulo can only operate on Integers.
Tableau Usage
For Modulo, the percent symbol ("%") is used in a Tableau Calculated Field. In the above statement, 9 MOD 2 would be displayed in a calculated field as 9 % 2. Additional Examples are shown in the workbook attached to this knowledge base article.
Common real-world uses of Modulo
- Determining whether a number is even or odd
- Find numbers that match a pattern (e.g. is the number a multiple of 100?)
- Performing 12-hour clock arithmetics.
- Grouping discrete values into arbitrary groups/buckets
This knowledge base article contains an attached workbook with examples for all of the categories listed above.