Alteryx Designer Desktop Discussions

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

Output a number that is 4 characters in length

poles1c
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

3 REPLIES 3
patrick_digan
17 - Castor
17 - Castor

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")
poles1c
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? 

poles1c
8 - Asteroid

Nevermind just realized it works! Thank you!!

Labels