Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

Output a number that is 4 characters in length

Highlighted
8 - Asteroid

Hi,

I need to output a number that is 4 characters in length. For example, if the number is one then I want it to be represented as 0001. How can I do this in Alteryx?

 

Thank you,

 

Courtney

Highlighted
16 - Nebula
16 - Nebula

Off the cuff I would say use a string variable and the padleft function. If you have a numeric variable to start with, it would be something like: 

Padleft(Tostring(Field),4,"0")
Highlighted
8 - Asteroid

Thank you for your help. Will this method work even if the number increments? e.g. say the number increases to 100, will this formula automatically output 100 as 0100? 

Highlighted
8 - Asteroid

Nevermind just realized it works! Thank you!!

Labels