Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

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

Parsing First and Last Name when there is a hyphen

Tessa
8 - Asteroid

Hi All,

 

I have a column of data that contains both the first and last name. I can use the example in the RegEx sample to easily parse most of it - except when it comes to names with hyphens. 

 

 

I'm using the brackets to illustrate how I want the cells to appear:

[Joe-Schmo Johnson] needs to be [Joe-Schmo][Johnson] 

 

I also get a NULL value if there is no first or last name; how can I replace a missing name with "N/A" or something to indicate it isn't there?

[Tom] becomes [NULL]

 

Thanks!!

15 REPLIES 15
mifrahm
8 - Asteroid

Hello there @Jonathan-Sherman ! I had a similar situation that I am trying to work on. There are two seperate files that I need to join on the basis of names.

 

In excel file 1

The names are list as below:

Brad Ge Va Gruz (where Ge Va Cruz is the last name)

Andre F Hooc (where F is middle initial)

John Smith

No Employee

TBH_#####

ABC_####

Joan Nithesa-Gone (where Nitesha-Gone is the last name)

Johnny Sean Hurtz (where Sean Hurtz is the last name)

John G Henry Jr  (where henry jr is last name)

 

In excel file 2 

The names are listed as an example below

John Smith

Joan Nithesa-Gone

Andre Hooc

Johnny Sean Hurtz

 

The only way to match data in both files is through the names. But because of file 2 not including middle initials it ends up having fallout data. Any way you can help me on this?

 

I tried copying the solution for @Tessa example. But it wasn't properly dicing it. Thanks for your help in advance from someone new to alteryx. 🙂

BrandonB
Alteryx
Alteryx

@mifrahm the tricky part will be  situations like Johnny Sean Hurtz (where Sean Hurtz is the last name). I could see a slight tweak making the example above work if the middle initial is ALWAYS one character long. 

 

You may have a situation better suited for Fuzzy Matching: https://community.alteryx.com/t5/Videos/Fuzzy-Matching-for-Beginners/td-p/330575

 

If you have non-identical names that you are looking to match, this may be more helpful than parsing out names. If you create a new topic and provide two sample tables of data to be matched I think the community should be able to help you build something that will get you close.

mifrahm
8 - Asteroid

Thank you for the reply @BrandonB - I just posted over here. https://community.alteryx.com/t5/Alteryx-Community-Ideas/How-to-Join-Names-when-formatted-differentl...

 

Open to any suggestions and appreciate your support!

mifrahm
8 - Asteroid

@BrandonB - is there anyone you recommend I can reach out to regarding fuzzy matching? Unfortunately, no one replied to the post I created.

BrandonB
Alteryx
Alteryx

@mifrahm it looks like it was posted to the Alteryx Designer Ideas page for new product suggestions rather than Designer Discussions where people address workflow related questions.

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/bd-p/designer-discussions is where you want to post

mifrahm
8 - Asteroid

Oh my... newbie problems haha! Thank you for calling this out!!

Labels