Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

show number in fixed length format

JokeFun
8 - Asteroid

Hi,

 

I have a list of numbers, from 0 to 999. I need to have them all shown as text format with length at 3. So 0 will be 000, 1 will be 001, 90 will be 090 etc.

 

I used a formula tool for this purpose, which works. But I think there should be another simpler function, just like in excel we can have text([Field1], "000").

 

if length([Field1])=1 then "00"+[Field1]
elseif length([Field1])=2 then "0" + [Field1]
else [Field1]
endif

 

Thanks,

 

2 REPLIES 2
ponraj
13 - Pulsar

Here is the sample workflow. Hope this is helpful. 

Capture.PNG

JokeFun
8 - Asteroid

@ponraj Hi Thanks, this is great! Learnt a new trick today.

Labels
Top Solution Authors