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.
解決済み

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

Ram_RK
アステロイド

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

3件の返信3
ShankerV
キャスター

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
アステロイド

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

CSchaeffer
メテオロイド

Perfect! Just what I needed. Thank you. 

ラベル
トップのソリューション投稿者