Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

ID number conversion

Shaopingfu
7 - Meteor

I have a staff ID list with maybe 4 or 5 or 6 digit, I want to convert this number to a 9 digit account number, starting with "E". 

If staff ID is 4 digit, account number is E + 0000+ staff ID

If staff ID is 5 digit, account number is E + 000+ staff ID

If staff ID is 6 digit, account number is E + 00+ staff ID

 

Which tool and formular is better to get this? 

2 REPLIES 2
Yoshiro_Fujimori
15 - Aurora

Hi @Shaopingfu ,

 

Please try this expression.

 

Account Number = "E" + PadLeft(ToString([Employee ID]), 8, "0")

 

I hope this helps

Pilsner
10 - Fireball

Hello, I have tried to solve your problem using a formula tool. There is a step in there which will return a null value if the original number is not 4,5 or 6 digits just to make sure you can identify anomalies like this if they did occur. The select tool is there to ensure the original ID column is stored as a V_string. I hope this helps

Screenshot 2023-08-14 091937.png

Labels