Alteryx Designer Desktop Discussions

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

Need Help - Removing leading zeros in some of the rows

nmitch
7 - Meteor

Hi - I have a data source with a column that has some IDs with leading zeros and some without. I'd like to clean up that column to remove leading zeros if they do exist. 

 

Example Data
Customer ID:

0011192977

10023511
11067502

0001308243

 

Expected Result

Customer ID:

11192977

10023511
11067502

11308243

 

3 REPLIES 3
Felipe_Ribeir0
16 - Nebula

Hi @nmitch 

 

Two options:

1) Use the function TrimLeft([Customer ID:],'0')

2) Change the datatype of the field to numeric with the select tool

 

Felipe_Ribeir0_0-1669999999895.png

 

TimN
13 - Pulsar

Hi,

There a probably a bunch of ways to do it but I like ReverseString.  I reverse the string then take the string length you want to be left with and then reverse again.  I'm assuming you have a typo on 0001308243.  Your output shows 11308243

 

 

nmitch
7 - Meteor

Hi @Felipe_Ribeir0 I used your first option and that did the trick - thank you!

Labels