In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Zip Code - maintaining leading zeros

lmaughan
7 - Meteor

I am having a problem reading in zip code data into Alteryx.  It is auto assigning the Double value by default which strips the leading zeros from the zip code.  I have tried converting to v_string, but the leading zeros are missing.  How does one keep the leading zeros on a zip code, or put them back on if they have been stripped off by Alteryx?

 

Thanks in advance for your help.

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @lmaughan 

 

You can use PadLeft() 

 

 

PadLeft([Field1, 6, "0") 

 

 

Here 6 is the required length. It will add "0"s to bring it to length 6.

 

Can you provide some sample data and expected zip codes for it.

messi007
15 - Aurora
15 - Aurora

@lmaughan,

 

You can use a padleft function 🙂

 

messi007_0-1628609427457.png

 

Attached the workflow. 

Hope this helps !

 

Regards,

lmaughan
7 - Meteor

Thank all for your recommendations -- this works!

james_swanson
7 - Meteor

Hello - when generating CSV files, the file format removes the leading 0's. Is there a way to special format an output so that the text is in zipcode/postcode format?

squinn95
5 - Atom

Did you find a solution to this? Thanks

Labels
Top Solution Authors