Just wondering if someone else could test this as it doesn't appear to be working for me in 10.5? It used to work for Strings (when a integer was formatted as a string) but now it only appears to work for Numbers (when formatted as numbers). Thanks
IsNumber() will be true for numeric types. IsInteger() may be what your looking for: that will assess the value rather than the type.
(http://help.alteryx.com/10.5/Reference/Functions.htm#Test)
Thanks. You are right the definition has changed for IsNumber from 10 to 10.5:
10 = ISNumber(v) Tests if v is a number or not.
10.5 = ISNumber(v) Tests if the field type for v is a number or not.
Have to be careful upgrading! Seems a bit concerning when a function's definition changes so much between releases! I will use IsInteger instead. Thank you again for your help.
I have to say this clarification was quite helpfull. But how to test if a a String contains a number (which isn't an integer) in Alteryx 10.5 ?
Not at my computer to test this, but one idea is to try converting the string to a number, then back to string, and seeing if the result matches the original string... e.g. [field]==ToString(ToNumber([field]))
The theory here is ToNumber will truncate the first non-numeric character and anything following, but it might still work for decimals.
ToNumber() returns 0 if the field contains no numeric value. So if I use it to test if the field contains or not a number, the result will always be true.