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.
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
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
try this please:
ToNumber([Postal Code]) > 1000 AND ToNumber([Postal Code]) < 2500
Thanks,
Mark
Good Morning Everyone,
I've merged two threads together on this post, looks like @MKAJ786's original post accidentally got duplicated.
Thanks!
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
Hey. This worked for me. THANK YOU!