This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
hi!
I have a field that I would like to add characters to at the beginning if they are missing. Please see simple example below, the two missing entries should also have "SI-" added to the beginning.
I would like to complete this using a Formula Tool.
Any help rendered truly appreciated.
State | ID |
MI | SI-1234 |
FL | 5678 |
CA | SI-2345 |
NM | SI-7890 |
OK | 8520 |
TX | SI-7412 |
MO | SI-6542 |
IL | SI-6548 |
WI | SI-9510 |
Solved! Go to Solution.
Hey @ZoeM, here's how I'd go about this, leveraging the StartsWith() function:
The exclamation mark is uses as NOT and so in this expression we're essentially saying: if the ID doesn't begin with SI then add 'SI-' to the ID number. The else tells Alteryx to leave the ID as is if it doesn't satisfy the if condition i.e. does begin with SI.
See if this fixes your problem.
While all solutions provided the same answer, I had to choose one :)