Filter between 2 numbers
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, I'm fairly new to Alteryx. I have data that has a column with postal codes and I want to filter these code between a particular range, lets say from 1000 to 2500. I wrote the expression in the Filter Tool as:
[Postal Code] > "1000" AND [Postal Code] < "2500". This doesn't seem to work as it gives me ALL values below 2500.
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Looking at your sample you are doing a string comparison. This means Alteryx is doing an alphetical check not a numerical check try:
ToNumber([Postal Code]) > 1000 AND ToNumber([Postal Code]) < 2500
or better still use a Select tool to change the type of [Postal Code] to an Int32 and then
[Postal Code] > 1000 AND [Postal Code] < 2500
will work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @MKAJ786
I am struggling to replicate that behavior (attached workflow shows the correct results)
In the workflow I have made sure I tested with both string and numeric data types. Both provide the same results, but if your postcodes are all numbers I would suggest making sure the data type is numeric before passing into the filter tool, as you are looking for a range.
Best,
Jordan Barker
Solutions Consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
try this please:
ToNumber([Postal Code]) > 1000 AND ToNumber([Postal Code]) < 2500
Thanks,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Good Morning Everyone,
I've merged two threads together on this post, looks like @MKAJ786's original post accidentally got duplicated.
Thanks!
Manager, Technical Account Management | Alteryx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
With a string data type, the initial expression would include "240" as this is greater than "1000" and less than "2500"
Thats my guess of the scenario seen.
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey. This worked for me. THANK YOU!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
