Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

IsNumber is not detecting number all the times

AshRez
8 - Asteroid

Greetings All,

  I am hoping someone can figure out why "IsNumber" is not working on some of the samples I came across. I am attaching a working workflow that has only a list of text in column "Value" which I extract the numbers that I need to convert it to a number column, but my requirement was to ensure it is a number before I convert it by using "IsNumber" then use "ToNumber", because I was trying to find out  the ones that can't be converted in the future to adjust the conditions, as the source is free text and people can enter different ways.

 in the sample, I extract the number using formula and using RegEx tools. Then testing the results from both to see if it "IsNumber" and both returned "False" even though visually you can see it is a number. 

So I thought maybe there is hidden character that I can't see, which preventing the value to be detected as a number, so I used regex replace to ensure it remove any value that is not a number, and then test it with "IsNumber" but unfortunately it still sees it as not a number.

But if you try to use "ToNumber" it works fine with no issue. so if someone could explain, what is going on with "IsNumber" and why is it glitching out?

I would appreciate your feedback and help. Thank you.

 

Screenshot 2025-02-06 113912.png

4 REPLIES 4
Deano478
12 - Quasar

@AshRez IsNumber() will be true for numeric data types. Maybe what you want to try would be IsInteger() this will look at the value rather than the actual data type

AshRez
8 - Asteroid

Thank you. 


The reason I use "IsNumber", because some of the numbers can be double, which is with decimals. if I use "IsInteger" on any value with decimal, it will also return false.
So the method you mentioned it will help improve detecting all the sample I provided as integer, but it won't detect any similar that could be with decimals.

To add context to what I am doing, I used the same method on over 350,000 records, and it was working fine to detect numbers in the "IsNumber", but for whatever reason, "IsNumber" isn't able to detect these few samples.

Deano478
12 - Quasar

@AshRez you could maybe give something like this a try in that case:

REGEX_Match([Filed], '\d*\.{0,1}\d+')
AshRez
8 - Asteroid

Yes this is a great way to detect it instead of "IsNumber". I am going to use this instead. Thank you.

 

I always thought that "IsNumber" detect if it is a number based on the value, not the type. Just like programming, but apparently it is not.

 

Thank you so much @Deano478 

Labels
Top Solution Authors