Consider the following scenario,

If we need to split these Customer Names into three columns with First Name, Middle Name and Last Name Columns, how do we achieve it in Alteryx?

There are millions of ways to do it; the most efficient way is through Regex.

 

Here is the Regex I discovered that could solve this problem

 

(^[[:alpha:]]+)\s*([[:alpha:]]*)\s+([[:alpha:]]+$)

 

 

 

And the result:

 

Everything is good apart from one case, if you have a first name or a last name that contains a space, such as “Lou Lan” or “Joe Jo”, this Regex could still give you some trouble. But in most cases, this Regex will work.

 

 

 

 

 

 

The Data School
Author: The Data School