## A short introduction to the Modulo Operator

by Henry Mak

The Modulo operator (%), not to be confused with the modulus (i.e. absolute value), returns the remainder of a division after one number is divided by another.

Some examples:

1. 10 % 10 = 0
2. 10 % 2 = 0
3. 10 % 3 = 1
4. 100 % 13 = 9

For example 1, 10 divided by 10 is 1 remainder 0. For example 2, 10 divided by 2 is 5 remainder 0. For example 3, 10 divided by 3 is 3 remainder 1. For example 4, 100 divided by 13 is 7 remainder 9. If it's not clear enough already, it's the remainder of the division which is the answer of the modulo operation.

Although perhaps niche, here are a few uses of this operator:

### Tableau and Alteryx

• In Tableau the modulo operator is %
• In Alteryx the modulo operator is Mod(n, d) where n is the dividend and d the divisor

This has been a short intro into the modulo operator. I hope it gives you some inspiration for its use cases and you keep it in your back pocket when solving problems.

In the next few blog posts I'll be writing about some of the specific use cases that I listed above.

Tableau Public Henry Mak

Sat 25 Sep 2021

Thu 05 Aug 2021

Mon 02 Aug 2021

Thu 05 Aug 2021