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 for whole numbers

Meteor

Hi,

 

I am trying to create a custom filter that will remove all decimals and keep only whole numbers. I have tried the following formula based on a post I saw in the community but it keeps telling me that it is a malformed function call:

 

REGEX_Match([Sum_ENTERED_DR], \d+)

 

can someone please assist?

 

Thanks!

Alteryx Certified Partner
Alteryx Certified Partner

Hi @danchips24 

 

Just quote your  expression and you will be fine.

 

Also, make sure your field is considered as a String if it is not.

 

REGEX_Match(ToString([Sum_ENTERED_DR]), "\d+")

 

 

Cheers,

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner
REGEX_Match([Sum_ENTERED_DR], "\d+")

 

Assuming that the sum_entered_dr field is a string.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Nebula
Nebula

Hi @danchips24 

 

If your field is numeric, you can use this

floor([Field1])=[Field1]

Does the integer portion of the number = the number 

 

Dan

 

Alteryx
Alteryx

@danchips24 You can also do the below in the filter tool.

!Contains(tostring([Field1]), '.')

Keeping it simple  

Digan
Alteryx
Alteryx Certified Partner
Alteryx Certified Partner

@danchips24 

 

Last but not least.

Good option - IsInteger function.

 

IsInteger([Field]) on Filter tool. 

 

Cheers,

Nebula
Nebula

@Thableaus 

 

IsInteger() - Built in Alteryx function.  Definitely the best option! 

 

Another hidden gem in the Test group of functions is 

 

CompareEpsilon(a,b,epsilon)   Used to compensate for the inaccuracies introduced with trying to represent base 10 decimals in Base 2

 

Dan

 

Labels