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

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Removing everything after a space

Meteoroid

Hello,

 

I have a series of ssns that have a space & 1 or 2 numbers at the end, such as 123456789 1. I am trying to removed everything after the space. I have tried several trim expressions but nothing works, either the space & number(s) are still there or it returns a zero. I'm thinking that possibly a RegEx expression will work but I'm not sure how to write it? Any help/suggestions would be much appreciated.

 

Thanks so much,

@kvoelker 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @kvoelker 

 

A Text to Columns tool using \s delimiter is very simple. It splits the expression in two columns, then you can get rid of the second one.

 

texttocolumns.PNG

 

Cheers,

Alteryx
Alteryx

Hi @kvoelker,

 

Use the Text To Columns tool from the Parse category.

 

Set '\s' (i.e. a space) as the delimeter and the number of columns to 2. Then you can remove the second column and you are left with the data you want.

 

Hope this helps.

 

Luke

Alteryx Certified Partner

Hi @kvoelker ,

 

use a Regex tool configured as follows:

 

regex.PNG

 

M.

Alteryx Certified Partner

As the others have mentioned, you can also use the text to columns on the space delimiter, but only if that is the only, or first space in the string.

 

M.

Meteoroid

Hi All,

 

The text to column solution that @Thableaus provided worked well. Thank you all so much for the help! You are the best!

 

Thanks again,

@kvoelker 

Labels