Alteryx Designer Desktop Discussions

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

Batch macro - multiple filters / control parameters

mis994
5 - Atom

Hi,

 

Relatively new to alteryx and need some help to resolve this urgently. I have large dataset in a single sheet that I will need to split into smaller files using 4 different filters (in columns). I have created a batch macro that worked with the first filter - which pulled out all the data based on the location code. For some of these locations, I will need to apply another filter for the cost center. Questions below:

 

1. Is the macro workflow below for the second filter correct? How do I go about applying a formula to skip this step if the input field is blank?

Screenshot 2025-01-18 192043.png

 

2. In the main workflow, how do I change the expression for both control parameters in the in Text input list to include both columns to flow into the macro?

 

Screenshot 2025-01-18 192013.png

Please any help on the above is greatly appreciated!

 

Thank you

6 REPLIES 6
OTrieger
13 - Pulsar

@mis994 
When you have multiple Control Parameter you will need to ensure that all the data for these parameters is available. When clicking on the macro you will need to Questions, and then you can set each Control Parameter. Select the first field for the first parameter and etc. So that is how you can set all your fields as parameters for the macro.

 

In the 2nd Filter Tool you can use a Custom and then write a conditional formula or add several conditions to fit your need.

You can connect the Control Parameter directly to a Q and not need to use Action Tool, it makes it easer as you will need only to select that input, nevertheless using Action Tool is totally fine.

Qiu
21 - Polaris
21 - Polaris

@mis994 
Is not using Batch Macro an option also?
We can use the Feature in the Output Data tool as below.

0119-mis994-A.png0119-mis994-B.png

mis994
5 - Atom

hi both, 

 

Thank you for your answers. @Qiu yes, I do not need to use Batch macros, so any easier way should work. Under the Feature in Output Data - how do I add more filter fields and is there an easy formula to put in so that if [plnt] is null, then skip the filter?

 

Thanks

mis994
5 - Atom

@Qiu Unfortunately I cannot find a way to import the filter criteria sheet as your workflow only has one input option. Please can someone help as I need this very urgently and am not the best at Alteryx. I have uploaded by macro workflows below.

Qiu
21 - Polaris
21 - Polaris

@mis994 
Than you for the update.

Can you share your input file as well? and also desired sample output?

0120-mis994.png

mis994
5 - Atom

Hi @Qiu,

 

Please see attached file - input on first tab and two example outputs.

 

Thanks!

 

Labels
Top Solution Authors