Is there a way to get the mod function to be something besides an integer? I'm trying to identify dollar amounts that end in regular values, but I get 0 for both mod(200, 100) and mod(200.91, 100). I realize I could always just multiply both by 100 (ie. mod(20091, 10000) would not equal 0), but that seems an awfully cumbersome way to go about it. Am I missing something?
Solved! Go to Solution.
@CowCookie You aren't missing anything. As per the help documentation (https://help.alteryx.com/current/Reference/Functions.htm?Highlight=modulo) the modulo function is an integer only operation. However, you could write your own formula to achieve the same result for floating point numbers if necessary.
Hi @CowCookie
Another way to do it is this formula
floor(Abs([Field1])) = abs([Field1])
which compares the absolute value of the integer portion of the number with the absolute value of the value. the Abs() is to get around the fact floor(N) always gives you the closest integer <= N and for negative values give you the next integer value i.e. Floor(-2.1)=-3.
Dan