Start Free Trial

Alteryx Designer Desktop Discussions

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

Concat - IF statement

ALLSEBS01
7 - Meteor

Hi, 

 

I'm struggling with how to do something on Alteryx.

 

I have a list like below, and if it is a 2 digit number I want to add 00 to the start, if it's 3 digits I just want to add 0 and if it's four I don't want to add anything. 

 

50
40
50
990
10
10
10
10
50
20
10
10
10
10
10
10
10
10
20
20
30
1320

1340

 

What tool/expression would I use to do this? 

 

Thank you!!

2 REPLIES 2
Carolyn
12 - Quasar
12 - Quasar

Hey! You want the PADLEFT function. 

 

First, you want to make sure your field is a String field. And then

 

=PADLEFT([Field], 4, "0")

 

The 4 is the number of characters you want it to have. And the "0" is what you want to add, on the left side, if it's less than 4 characters

 

Edit to clarify my screenshot formula: Since my [Field1] was a number, I had to add a ToString around it, but if it's a String to start, you won't need to do that

 

2024-09-13_09-19-00.png

ALLSEBS01
7 - Meteor

Thank you!

Labels
Top Solution Authors