community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Abbreviate First names and sort by Last names

Meteoroid

Hi everyone

 

 

First thank you for taking time! I have a question on probably parsing data.

I want to have a list of name as below on the left and want to rearrange to show like right. Typical is to step 1. abbreviate first name, step 2. Rearrange/ sort  by their last name in alphabetical order

 

Before:                                    after:

Kate Roberson                         E. Ames

Peter Johnson                          P. Johnson                             

Louise Macy                             L. Macy

Emliy Ames                              K. Roberson

 

Can anyone help?

Alteryx Certified Partner
Alteryx Certified Partner

Hi @SurvivorLouise 

 

I think this Regex would work:

 

REGEX_Replace([Field1], "^(\w).*?(\s.*)", "$1.$2")

 

SolutionR.egex.PNG

Then you use the Sort Tool at the end.

 

Cheers,

Highlighted
Alteryx
Alteryx

Hi, I would do it this way (Workflow attached):

 

2019-05-30_23-35-57.756.png

 

 

Labels