ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
GELÖST

How do I pad leading Zeros?

brad_shannon
Meteoroid

I have:

1234500

 

I want:

00001234500

 

I'm new.

13 ANTWORTEN 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
Meteoroid

Thanks very much for that.

brad_shannon
Meteoroid

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

brad_shannon
Meteoroid

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

jcornale
Meteor

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

anthony123
Asteroid

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

anthony123
Asteroid
 
LordNeilLord
Aurora

Hey @anthony123

 

Any string will do

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Beschriftungen
Top-Lösungs-Autoren