Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

How do I pad leading Zeros?

brad_shannon
6 - Meteoroid

I have:

1234500

 

I want:

00001234500

 

I'm new.

13 REPLIES 13
patrick_digan
17 - Castor
17 - Castor

The padleft function should do the trick: 

PadLeft([Field1],11,"0")

If it's a numeric field, you would want to add a tostring first:

 

PadLeft(tostring([Field1]),11,"0")
MarqueeCrew
20 - Arcturus
20 - Arcturus

@patrick_digan,

 

I know you're thinking, "I'm going to beat Marquee Crew" to the answer."  You know what?  You beat me!

 

Happy Friday :)

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
brad_shannon
6 - Meteoroid

Thanks very much for that.

brad_shannon
6 - Meteoroid

Now if you could just finish up the rest of my broken workflow..  lol.

brad_shannon
6 - Meteoroid

I'll have to remember that - when all else fails.

jcornale
7 - Meteor

You all are brilliant. That's all. Cheers.

anthony123
8 - Asteroid

I'm new. What data types does this work with? Also, does it matter if it's VW String, VString, String?

anthony123
8 - Asteroid
 
LordNeilLord
15 - Aurora

Hey @anthony123

 

Any string will do

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Labels