Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Filtering using IN

trevorwightman
8 - Asteroid

Hello,

 

Assuming I have a values columns with the letters of the alphabet I can do a filter [Values] IN ("A", "B") and this will give me all rows that are either A or B.

 

However, if I want this filter to be dynamic and I create a field, "Filter", where all values are a string, ("A", "B"), why doesn't the following filter work: [Values] IN [Filter]

 

I have attached a workflow with this example.

 

Thank you!

4 REPLIES 4
binuacs
20 - Arcturus

@trevorwightman Alteryx will throw an error when you mention the filter like the above. the below post will help you to understand how you can achieve dynamic filtering

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Dynamic-Filter-Based-on-list-of-data-v...

Felipe_Ribeir0
16 - Nebula

Hi @trevorwightman 

 

It does not work because alteryx (besides the missing () in the IN that was causing an error) is understanding your filter as 1 unique string component ("A", "B")

 

To understand it better, try to test a dataset with Value = ("A", "B") and Filter = ("A", "B"). The filter will work. Make sense?

 

Felipe_Ribeir0_0-1668207484131.png

 

Take  look at the attached workflow to see this test and a simple alternative using the contains formula to achieve the desired result.

trevorwightman
8 - Asteroid

@binuacs Thanks for the reply! I knew about the macro option to achieve dynamic filtering and was essentially trying to reengineer it without having to use a macro to achieve the string that gets replaced after "IN". Any idea why this does not work technically?

trevorwightman
8 - Asteroid

@Felipe_Ribeir0 Got it, that makes sense! With the answer from @binuacs he recommended using the interface tools to achieve a dynamic filter and this works because this sends individual values into the filter whereas, like you said, when I did it Alteryx it is recognizing ("A", "B") all as one string and not actually separate values so it doesn't know to search seperately for "A" and then "B".

 

Thank you both!

Labels