Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Filter out cells with text only

cstafford
8 - Asteroid

I have a column of data that contains numbers, text, etc.. However, I want to filter out any records with text. What is the best way to do that? 

7 REPLIES 7
Nanoq
8 - Asteroid

Parse it to a new column using (\w+) and then filter on the new column with !isnull(new field)

MarqueeCrew
20 - Arcturus
20 - Arcturus

Regex_match([field],"[\u\l\s]+")

 

 

 letters and space only

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
jrsheppard
7 - Meteor

Drop a filter tool onto the canvas, select "custom", and enter the following expression: !REGEX_Match([Field_Name], ".*[[:alpha:]].*").

 

Make sure to replace the [Field_Name] placeholder with the actual field name.

cstafford
8 - Asteroid

This works great, however, I noticed some of the data also has text after a number. Ex 1234_DOT and 1234DOT. How would I capture these conditions?

jrsheppard
7 - Meteor

Take a look at the sample workflow attached with the filter configured - it should remove the data for you.

jrsheppard
7 - Meteor

I also want to verify the use case.  From the original post, it seemed like you wanted to drop the record from your dataset that contained any letters.  Can you confirm this?

 

However, I realized you may be trying to cleanse your data - meaning keep the records in the dataset - but remove the text and other items.  For example: convert "1234_DOT" to "1234".  If this is the case, I suggest using a data cleanse tool.

 

Best,

Jesse

cstafford
8 - Asteroid

yes, only looking to drop records with letters. 

Labels