How to Add Leading Zeros to a Field in Tableau

By: Eric Parker

Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email. You can also sign up for a Tableau Office Hour to work with him directly!

Do you have a field that needs leading zeros added? Maybe a postal code or ID that got formatted as a number and as a result dropped the leading zeros? If that's the case, check out this video for a couple alternatives to get those leading zeros at the beginning of your field again!

Here is a link to access the worksheet from the video on Tableau Public.

Here is the calculation from the video:

LEFT('00000', (5 - LEN(STR([Customer ID (Number)]))))

+

STR([Customer ID (Number)])

How to Remove 'Abc' From a Worksheet in Tableau

Top 10 Things I Wish Tableau Would Change

0