Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Text to Columns

YLYONG
9 - Comet

 

hello!

May I know how do I remove the zeros at the front of below numbers?

 

P. TU IDP. TU ID
000202642460202642460
000202642390202642390

 

YLYONG_0-1656645128175.png

 

Thank you for your help!

5 REPLIES 5
Qiu
21 - Polaris
21 - Polaris

@YLYONG 
We can use a RegEx parse with below.

0+([1-9]\d+)
grazitti_sapna
17 - Castor

@YLYONG, text to column reads only 1 delimiter, so in case you want to remove starting 000 you can try this,

grazitti_sapna_0-1656649097952.png

Formula:

if StartsWith([P. TU ID],"000") then
tonumber(ReplaceFirst([P. TU ID],"000",""))
else tonumber([P. TU ID]) endif

 

I hope this helps!

 

Thanks!

 

 

Sapna Gupta
flying008
15 - Aurora

Hi, @YLYONG 

 

the easy formula for you, also can add tonumber() for the outside if need.

 

TrimLeft(tostring([P. TU ID]),'0')

 

 

YLYONG
9 - Comet

@Qiu @grazitti_sapna @flying008 Thank you all for your suggested solutions!

grazitti_sapna
17 - Castor

@YLYONG, if these solutions worked for you please mark them as solutions so they can help others for future reference.

Thanks!

Sapna Gupta
Labels
Top Solution Authors