Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

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
15 - Aurora

Hi @Shaopingfu ,

 

Please try this expression.

 

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

 

I hope this helps

Pilsner
13 - Pulsar

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
Top Solution Authors