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 numbers smaller than 0 in column type V-WString

Minh
6 - Meteoroid

I am trying to get rid of numbers smaller than 0 in column A. Column A is type V-WString. I tried using the filter tool after convert the column type to double but could not find a way for this issue. Can you help? Thank you

 

This is the sample I have:

Question1.PNG

 

This is the desired outcome:

Ans.PNG

4 REPLIES 4
Luke_C
17 - Castor

It might be as simple as just doing a filter for records that do not contain the dash, assuming that there are no other dashes in the column outside of negative numbers.

 

You may want to look into why you have two sets of headers in the data though. I'd imagine if you get rid of the duplicate headers you could convert the column to be numeric easily and do a filter for >0. 

 

Luke_C_0-1616706359442.png

 

 

apathetichell
18 - Pollux

you can use a filter with:

not(REGEX_Match([numbers],"[-]\d*"))

 

- that assumes you need to keep the rows with "numbers" as a value.

 

Another option is something along the lines of:

contains([numbers],"numbers") or tonumber([numbers])>=0

 

Qiu
20 - Arcturus
20 - Arcturus

@Minh 

Try this and it should work even it is not an integer.

Capture1.PNG

AkimasaKajitani
17 - Castor
17 - Castor

Hi @Minh 

 

This function work well, too.

 

AkimasaKajitani_0-1616724277956.png

 

The ToNumber function returns 0 when it encounters a non-numeric value.

 

Labels