Padleft requires one to define how many characters to go left , how can I always just put a 0 to the front of a string no matter the length?
'0' + [String] should do it, unless I'm oversimplifying
@Luke_C works, but what if it is an integer?
@wonka1234 can you try '0'+toString([Amount]) and change your data type to V_String
Formula tool - "0" + ToString([yournumber])
@TheCoffeeDude doesnt work!
It works for me and that's how I was able to produce the screenshot. So let's ask this question, what does your formula look like?
Better yet... I downloaded your workflow. Ran it. It threw an error, so I entered debug to see what's going on. Your output column is still remaining as "F4" which is of Int32 data type.
Hi @wonka1234
Alteryx(and most other programing languages) automatically strip leading 0s from numeric fields. To display leading 0s, you need to convert the field to a string type. Make sure you do this just before you output the data, since you can't do math on string fields without the liberal use to ToNumber() functions.
Dan
User | Count |
---|---|
107 | |
82 | |
70 | |
54 | |
40 |