Jump to content

This topic is 8360 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Yes, it is called Modulo, or MOD for short. It returns the remainder of the integer division of a number. Lets say you have a number

field called 'inum'. MOD(inum,2) will return either a 1 or a zero. If you would like the expression to return either 1 or 2, do the following: MOD(inum-1,2)+1. Since this is integer division and really only the remainder, it doesn't make any difference how big inum is:

1001 returns 1, 1002 return 2 (if you use the -1 and +1 expression).

Posted

This calculation can also be used to differentiate odd and even weeks if the number involved is a week(date) calculation.

e.g - assuming field week number is week(date) calc

Case(mod(week number;2) = 1; "odd week";"even week")

This is useful if you have to set startup scripts do things on a fortnightly basis.

(Just thought I'd throw it in for anyone who is interested)

This topic is 8360 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.