Alteryx Designer Desktop Discussions

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

Removing everything after a space

kvoelker
7 - Meteor

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 

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

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,

LukeM
Moderator
Moderator

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

mceleavey
17 - Castor
17 - Castor

Hi @kvoelker ,

 

use a Regex tool configured as follows:

 

regex.PNG

 

M.



Bulien

mceleavey
17 - Castor
17 - Castor

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.



Bulien

kvoelker
7 - Meteor

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