community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Filter numbers

Alteryx Certified Partner

@BarnesK @Thableaus 

 

True story, yesterday I created a workflow that scraped the history of community posts (sorry community admins!) so I can work out the optimal days and times to hang out on the forum to solve problems.

 

I may blog about this but here's some early insight (times in UTC) - hotter zones are where the most problems are posted to the Designer forum:

Screenshot 2019-05-17 at 14.06.43.png

 

 

 

 

 

 

 

 

 

 

Pulsar
Pulsar

@jonathanzadeh Absolutely!

 

The .* means 0 or more of whatever character and the \d+ means at least one digit (number). Overall, the expression is saying look for at least one digit somewhere in your record. If it finds one, it will come out the true side of the Filter. The reason this works here is because we are under the assumption that your "NA" records will not also contain numbers. 

Alteryx Certified Partner
Alteryx Certified Partner

@jamielaird 

 

Wow, impressive. You took this to a higher level!

 

I'm more like @danilang, trying to have fun while I'm learning a lot from different situations.

 

The Alteryx Community is amazing and I really hope to get to know all of the experts at the Inspire Conference this year.

 

Cheers,

Nebula

@BarnesK , @jamielaird@Thableaus 

 

Don't forget the optional minus sign

 

REGEX_Match([Field1], '-{0,1}\d+|-{0,1}\d+.\d+')

 

Dan 

@BarnesK - if i just had \d+ if would look for any cell with at least one digit right? Does that include 0? Further, what is the need .*? Can't i just had the \d+ and it will automatically find any cell with an integer?

Alteryx Certified Partner

@Thableaus Definitely! I've only really got involved in solving problems on the community in the last couple of months and didn't realise how much fun it is.

 

It's definitely not a competition, and that's just as well because @MarqueeCrew's stats are unassailable :D

 

Screenshot 2019-05-17 at 14.22.05.png

Highlighted
Nebula

@jamielaird 

 

Good work on the scraping.   And...Wow!  You've really made a splash this month.  With you, @Thableaus and @afv2688 this active, I don't think I'll ever make top contributor again.

 

Dan

 

 

Alteryx Certified Partner

@danilang Don't worry there are plenty of problems to solve!

 

Screenshot 2019-05-17 at 14.27.34.png

Pulsar
Pulsar

@jonathanzadeh 

 

Yes, it would include 0 if you just had \d+. The reason I added the .* is in the case there were any numbers with decimal points. If you only had \d+, it would only keep whole numbers. Technically since the decimal point would come first, you wouldn't need the second .* and could just use the expression 

REGEX_Match([Field1], ".*\d+")

 

 

Yet another option would be 

REGEX_Match([Field1], "\d*\.?\d+")

 

Which is saying look for 0 or more digits then an optional decimal point (we are telling Alteryx that it is optional by putting the question mark after it and we have to put the \ before it to tell Alteryx that it is looking specifically for the decimal point and not just any character) finally followed by at least one digit.

 

It all depends on how specific you want to get and what your data looks like! :) 

Labels