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

Alteryx designer Discussions

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

Remove all characters after initial whitespace.

Meteor

I'm trying to remove all characters that happen after initial whitespace. Should be a pretty simple split, but I can't figure it out. Example below:

 

PM AWI -> PM

123 GAM -> 123

1nas89 aee aer -> 1nas89

 

Thanks!

Matt

Alteryx Certified Partner
Alteryx Certified Partner

Hi @mattcoleman 

 

What about a Text to Columns Tool?

 

Solution.PNG

 

Cheers,

Meteor

You could use the formula tool to grab the string up to where the space occurs.

 

Left([InputField], FindString([InputField],' '))

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@mattcoleman 

 

You can also try regex.

 

REGEX_Replace([Field1], "(.+?)\s.*", "$1")

 

or REGEX_Replace([Field1], "(\S+)\s.*", "$1")

 

Cheers,

Meteor

All of these methods actually work, so thanks! I prefer the LEFT formula tool or REGEX over the Text to Columns tool due to the creation of an additional column.

Labels