Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Dynamic Filter Macro




I am trying to create a macro where a user can upload a file with the following fields (Field, operand, Operator, OutputBranch, OutputField)

and it will filter another file based on the data in the previous file. 


Essentially, I am trying to create a dynamic filter where a user can simply upload a file with the filter criteria in it. 


Is this possible in Alteryx?


I have uploaded a sample data file, and a sample filter file. The filter would also need to handle more complicated operators, such as contains and not equal to, and things like that.  


Thank you!



Depending on how well you can train users on syntax or control the file upload, the CReW macros have a really powerful Dynamic Formula tool.


You could essentially configure an input into this, and then add something eg: IF (Your user formula) Then 1 Else 0 ENDIF and then set up a filter with something like [FilterCriteria] = 1


If you still want more control than this, you could probably use the ideas in the Dynamic Formula tool to build a Filter tool to accomplish this


Take a look at the attached and see if this gets you there.  The trickiest part was the operator.  I couldn't think of a good way to implement, so I ended up using a switch statement in a Formula tool and running through the possibilities.


Hope it gets you closer!

Thank you so much! That was super helpful and got me really close to what I needed!