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.

 

 

 

 

 

 

Luke Yin
Author: Luke Yin

Before joining the Data School, Luke was a PhD researcher studying urban history of global cities at the University of Melbourne. Previously, Luke worked as an internal accountant for a Melbourne local winery. When conducting urban research, Luke discovered his passion for data visualisation and analysis through a number of university-based digital projects. Later, this became the reason for him to join the Data School. Luke wants to combine his expertise in research and business with data analysis to help solve real-world problems.