Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

split/filter a column with numbers and text

JokeFun
8 - Asteroid

I have a column where both numbers and text exist. I'd like to split them into two streams, one with numbers only, and the other with text or text plus numbers.

Say column A has below values

100

Amazon

Book21

200

Help/Date

...

I want to filter out the text values and keep the numbers only.

17 REPLIES 17
Qiu
21 - Polaris
21 - Polaris

@JokeFun 
RegMatch maybe is the tool we need

Capture1A.PNG

JokeFun
8 - Asteroid

@Qiu Thanks, I just tried, it works for numbers with no decimals, but also excludes numbers like 123.12. How can we do that o include all numbers?

atcodedog05
22 - Nova
22 - Nova

Hi @JokeFun 

 

A super easy way to get numbers only is to use select tool convert field to numeric field (double) this will convert all non numbers to null. Then filter on null. This will handle decimals as well as negative.

atcodedog05_0-1621313254507.png

 

Output:

atcodedog05_0-1621313476398.png

Hope this helps 🙂

Qiu
21 - Polaris
21 - Polaris

@JokeFun 

Trust the force, trust the RegEx. 😁

Capture1B.PNG

Qiu
21 - Polaris
21 - Polaris

@atcodedog05 
The king has returned. 😁

JokeFun
8 - Asteroid

@atcodedog05 I was using Select tool. But this will populate Conv error messages when the field is text.

atcodedog05
22 - Nova
22 - Nova

Hi @JokeFun 

 

Its a warning message which you are getting for converting string to number. Warning message is not a major issue it doesnt affect your execution.

atcodedog05
22 - Nova
22 - Nova

Hi @Qiu 

 

Those are some super highly big words 😅 i cannot accept them 😅

atcodedog05
22 - Nova
22 - Nova

Hi @JokeFun 

 

If your unconformable with warning messages. We can extend on @Qiu's solution to accommodate negative numbers. 

 

atcodedog05_0-1621315992977.png

 

Hope this helps 🙂

Labels
Top Solution Authors