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!!
Solved! Go to Solution.
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
Thank you!