Alteryx Designer Desktop Discussions

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

Custom Filter using Contains In

elclark
8 - Asteroid

Hello,

 

I'm trying to filter a field for multiple criteria so if it has any of these codes, it should be in the population. I tried this expression in the customer filter section but that's not working. I'd rather not do multiple Contains OR statements because I have sometimes a very large number of criteria to filter by.

 

Contains([Field] IN (5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010))

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @elclark 

 

Contains cannot be used this way. Contains can only be used this way

atcodedog05_0-1608056854870.png

 

If its exact code in the fields you can directly use.

 

[Field] IN (5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010)

 

Hope this helps 🙂

elclark
8 - Asteroid

I'm not sure what you mean by your last statement

 

"If its exact code in the fields you can directly use.

 

[Field] IN (5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010)"

atcodedog05
22 - Nova
22 - Nova

Hi @elclark 

 

If field = 5000 or field = 5001....

 

Then you can use in like mentioned. Or else you In.

 

You need multiple contains with IN.

elclark
8 - Asteroid

I see, thanks! It wasn't working at first and realized I had to add the quotations like I listed below and now it works.

 

[Field] IN ("5000","5001","5002","5003","5004","5005", "5006","5007","5008","5009","5010")

atcodedog05
22 - Nova
22 - Nova

Glad to hear you figured it out 🙂 

 

Happy to help 🙂 @elclark 

 

Cheers and Happy Analyzing 😀

 

Feel free to reach out if you face any issues 🙂

Labels