Alteryx Designer Desktop Discussions

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

I need to filter on 32 different strings, how can I do this in a batch macro?

russell90021
5 - Atom

I have 32 values and instead of placing 32 filter tools into my canvas, is there a way I can leverage a batch macro to go through and filter on all 32?

3 REPLIES 3
MelGibson
10 - Fireball

 You can create your filters within the workflow and then select all filters and right click and convert to a macro.

KGT
12 - Quasar

I'm not sure if this applies to your use case, but if you are looking for the same exact value across those fields, then there is a way in a single filter. If you are looking for either contains or a different values per field, then this simple IN filter won't work.

 

Note that this is looking for equal matches, not Contains. The following will look across all the fields in the "IN" Clause to match the text "Tax".

  • "Tax" IN ([Pay Item],[Pay Item Type],[Company])

If you are filtering different values on the 32 fields then you would need to pass the list of those fields to the batch macro...

 

I've just realised that you may be talking about having a list of 32 strings, and needing to filter one single field on that list. In that case, it's the reverse of the above formula, 

[FieldName] IN ("Term1","Term2")

 

If you want that in a batch macro to maybe use contains, then your batch input (Control Parameter) will be the list of terms so that one term at a time is evaluated. You will need to configure that after using @MelGibson method above.

Qiu
21 - Polaris
21 - Polaris

@russell90021 
I would go with approaching with a Mapping file containing the 32 different strings then use it with a Find and Replace tool as below.

0109-russell90021.png

Labels
Top Solution Authors