Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Custom Filter Using 'AND' Not Working

Wrichard
5 - Atom

Hi There:

 

I'm trying to do a custom filter to pull back just US and MX country codes from my data. When I do the basic filter [Country] = "US", the output in the T point is accurate. However, when I try doing the following custom filter, I don't get any results in the T point. 

 

[Country] = "US"
AND
[Country] = "MX"

 

Any help or guidance is much appreciated. Am I using the AND function incorrectly here? Do I need ( ) around each filter?

 

Thanks! 

3 REPLIES 3
patrick_digan
17 - Castor
17 - Castor

@Wrichard You actually need to use an or statement:

[Country] = "US"
OR
[Country] = "MX"

You could also switch to an In function:

[Country] IN ("US","MX")
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Wrichard ,

 

I think, you have to use "OR" to get the result you expect. [Country] = 'US' AND [Country] = 'MX' means, that the field [Country] has both 'US' and 'MX' at the same time  - this is impossible. If you use "OR", only one of the conditions has to be true, records with [Country] = 'US' and [Country] = 'MX' are selected.

 

Let me know if it works as you expect.

 

Best,

 

Roland 

Wrichard
5 - Atom

That did it! Thank you all! 

Labels
Top Solution Authors