We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

IsInteger and leading Zeros

kevind0718
7 - Meteor

Hello:

 

I have a hard time believing what I am seeing here.  

I am using IsInteger to determine if a string is an integer (is a zip code).

What I found is that IsInteger gets confused by leading zeroes.

 

Attached is  simple workflow.

 

Here are my results

Field1 Check
20220228   True
20200331   True
20270220   True
20161001   True
00112233   False
001234       False
010101       False

 

 

What am I missing here.

 

Best Regards

 

KD

11 REPLIES 11
kevind0718
7 - Meteor

There are postings out there that suggest that IsInteger can be to determine if a string is an integer.

So this will not work all the time.  Not reliable.  

For me the work around is to use Regex.  Regex is it's own special joy.

 

Thanks for your attention to this matter.

 

KD

mwoods1
5 - Atom

Hi, a bit late to the party with this one but you can combine the trimleft() function to get what OP is after without using regex:  

 

IsInteger(TrimLeft([Field],"0"))

Labels
Top Solution Authors