Alteryx Designer Desktop Discussions

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

How to Add leading Zeros to a column which has String Value

Ram_RK
8 - Asteroid

How to add leading Zeros to a column which has 6 digit number 

 

like "123456"  I need to make it as "0000000123456"  - I need to make this number as 13 digit number entire Row

 

Numbers in the column like 

123456 

654321

1111111

2345

112

 

Wanted to convert like below all the values in the particular column 

0000000123456

0000000654321

0000000111111

0000000002345

0000000000112

2 REPLIES 2
ShankerV
17 - Castor

Hi @Ram_RK 

 

Please use the function Padleft() to get the desired output.

 

Step 1: Formula tool

PadLeft(ToString([Column A]),13,'0')

 

Many thanks

Shanker V

Ram_RK
8 - Asteroid

Thanks Shankar I got that 

 

I applied this formulae as it contains Text also and the formulae should Avoid text 

 

 

In formulae Tool >>>>>> 

 

if IsInteger([Value]) then
PadLeft([Value], 13, '0')
else
[Value]
endif

Labels
Top Solution Authors