Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Filter for combinations using macros

suzi123
5 - Atom

Hi all - I built a workflow where I filter for a specific segment and category at the beginning of the workflow. However, I have ~200 combinations of segment-category but I do not want to create 200 filters to run the analysis each time. Is there a way to filter for each combination using a macro so that I filter for each combination, run the analysis and union all at the end? Thank you very much in advance!

5 REPLIES 5
ShankerV
17 - Castor

Hi,

 

Yes, its possible.

 

1: Create unique values of the columns where you are using category

It will create morethan 200 category unique values

2. Use recordID tool to have unique identifier for each category

3: Then you can pass dynamically each category for filter.

 

Many thanks

Shanker V

 

JamesCharnley
13 - Pulsar

Hi @suzi123,

 

I don't think you really need a macro here, especially assuming you're applying the same logic to each category. If you have a list of segment-category pairs you want already, then the easiest thing to do is Outer Join your data against another table containing those pairs, and then your Join Output will only have relevant categories that you need.

suzi123
5 - Atom

Thank you for the reply @JamesCharnley

 

I would like to run my analysis for each combination individually (e.g., I'm working with SKU level data where I want to know the revenue % of a SKU within a given category-segment combination of SKUs). That's why I'm looking for a way to filter for each combination then run the analysis separately for 200 times. Won't a need a macro for that?

JamesCharnley
13 - Pulsar

Fair enough @suzi123. It might be possible to do without, but a batch macro will definitely work so it's a good idea to do. You'll want to build a batch macro, where your unique category-segment pair is fed into your control parameter, so the corresponding rows from your data are batched into that macro one at a time and the logic is applied to each pair separately.

 

Here's a good link for getting started with batch macros if you haven't built one before: https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Getting-Started-with-Batch-Macros/t...

suzi123
5 - Atom

@JamesCharnley - thank you very much, I'm using a batch macro

Labels