Alteryx Designer Desktop Discussions

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

Filtering all types of numbers

Aakash1
6 - Meteoroid

Hi, I have a file with "GBP Amount" Column, which has whole numbers, decimal numbers, positive and negative numbers as well. I want to filter out those cells, which have anything apart from numbers. For eg: I want to filter out, blank cells, cells with characters, dots etc.

 

"GBP Amount"

0.0023

-1.33

abcd

-0.25897

5369

..

(blank)

-10025

 

in the above sample, I want to filter out "abcd", "..", "(blank)"

3 REPLIES 3
Emil_Kos
17 - Castor
17 - Castor

Hi @Aakash1 

 

I have used two different filters to make it more clear how it works:

REGEX_Match(["GBP Amount"], '\d+|\d+.\d+') - it is looking for any number or digigs or any number of digits with decimal space. | This sign represents the or statememnt.

 

REGEX_Match(["GBP Amount"], '-\d+|-\d+.\d+') - same thing but we are looking at the negative numbers.

 

This is the workflow: 

Emil_Kos_0-1603004353030.png

This is the final output:

 

Emil_Kos_1-1603004474294.png

Hope it helps!

Qiu
20 - Arcturus
20 - Arcturus

@Aakash1 
@Emil_Kos has given an elegant way, but I have a bit brutal way for your choise.

1018-Aakash1.PNG

KK12
7 - Meteor

Hi

 

There is a quite simple way to do it without application of Regex as well.

 

Just use select tool and change the type of the column to "Double" and run the workflow. You will notice that all other cells which are not numbers (eg. text/any other special character/dot) will be shown as "Null" in the output. Just filter out the Nulls and you will get the solution.

 

 

Let me know in case still facing any challenge.

 

Thanks,

Kirti Khetrapal

Labels