In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Remove all characters after initial whitespace.

mattcoleman
8 - Asteroid

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

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @mattcoleman 

 

What about a Text to Columns Tool?

 

Solution.PNG

 

Cheers,

KP_DML
8 - Asteroid

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

 

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

Thableaus
17 - Castor
17 - Castor

@mattcoleman 

 

You can also try regex.

 

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

 

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

 

Cheers,

mattcoleman
8 - Asteroid

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
Top Solution Authors