Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to Identify based on - on the nth character

DavidDiazPagan
5 - Atom

Hello, 

 

This is my first post so apologies if I'm not presenting enough information. I am attempting to improve a workflow that can create a new column to identify whether a specific cell is either a Social Secuirty Number (SSN), an Employer Identification Number (EIN), or neither. SSN's usually have two hyphens in between the first three and second two numbers (XXX-XX-XXXX) and the EIN have only one dash after the first two numbers (XX-XXXXXXX). Is there a tool in Alteryx that can help identify which column is SSN vs. EIN vs. neither? For example:

 

 New Column
SSN/EIN/OtherTax ID
111-22-3333SSN
11-2222222EIN
22-3333333EIN
25E7514UOther

 

The only way I've figured out to do this is to use text to column in order to get the numbers before the first hyphen and categorize them based on the number of characters but I feel like it's a bit of an extra step and not as accurate. Please let me know if there is an easier way to work on this. 

 

Thank you so much in advanced!

David

5 REPLIES 5
DavidP
17 - Castor
17 - Castor

This can quite easily be done with a regex function as shown below. Sample workflow attached.

 

ssn ein.png

DavidDiazPagan
5 - Atom

Didn't know about this formula. Thank you so much! Way better than multiple tools to identify these items. Much appreciated!

cmcclellan
13 - Pulsar

You would probably want to add some additional criteria in there as well, it depends if the location of the dashes are important.  If they are, you should check the position of the dashes (for SSN) or the single dash (for EIN) as well.

DNS
5 - Atom

I am using formula "RIGHT(B2,LEN(B2)-FIND(CHAR(1),SUBSTITUTE(B2,"-",CHAR(1),4)))" in excel.. How do I replicate the same in Alteryx?

cmcclellan
13 - Pulsar

I think you should create a new topic ;)

Labels