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.
RÉSOLU

How do I pad leading Zeros?

brad_shannon
Météoroïde

I have:

1234500

 

I want:

00001234500

 

I'm new.

13 RÉPONSES 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
Météoroïde

Thanks very much for that.

brad_shannon
Météoroïde

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

brad_shannon
Météoroïde

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

jcornale
Météore

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

anthony123
Astéroïde

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

anthony123
Astéroïde
 
LordNeilLord
Aurore

Hey @anthony123

 

Any string will do

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Étiquettes
Auteurs des meilleures solutions