Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to use Batch Macro to loop through a chunk of transformation?

Ryanz3653
7 - Meteor

Hello community, I am working on a workflow as following structure:

 

Data input - Filter to Workcenter: "WorkcenterA" - Transformation (a big chunk of transformation/calculation) - output

                 -  Filter to Workcenter: "WorkcenterB" - Transformation (a big chunk of transformation/calculation) - output

                 -  Filter to Workcenter: "WorkcenterC" - Transformation (a big chunk of transformation/calculation) - output

                 -  Filter to Workcenter: "WorkcenterD" - Transformation (a big chunk of transformation/calculation) - output

...... and so on, at the end I need to union all of their output, that is my goal

(I cannot skip the Filter to workcenter part, because it will cause the calculation result differently)

 

I have about 40 unique workcenter that i need to do this way, after I copy and pasted those big chunk of 5-6 of them I found that workflow is getting very slow, and I heard that the Batch Marco can achieve the goal with only one big chunk of transformation and loop through workcenter and union at the end, how to do that? 

 

I hope these make sense, Its hard to provide a sample dataset, but I will try:

The sample input:

Workcenter Order Metric_A Metric_B Metric_C

Line1U001256
Line1U002347
Line2U003569

.....

 

Output:

Workcenter Metric Stat Value

Line1Metric_AMin2
Line1Metric_AAvg3.0
Line1Metric_AMax5
Line1Metric_BMin4
Line1Metric_BAvg4.5

....

No need to work on the transform part, I have already done, the key point is to avoid filter each single one of the Workcenter and use Batch Marco to 'loop' through to reduce the workflow complexity and improve its performance.

 

Thanks for your help

 

Screenshot 2025-05-07 153903.png

7 REPLIES 7
KGT
13 - Pulsar

This is a pretty standard use case for a Batch Macro. Take a look at the batch macro interactive lesson here: https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Macros

 

The workcenter field will be your Control Parameter (Batch decider), which is the upside down question mark input into your macro.

Qiu
21 - Polaris
21 - Polaris

@Ryanz3653 
The question is that the "a big chunk of transformation/calculation" is all same for all the Workcenters?
If yes,or limited variances, then we can use the Batch macro.
Otherwise, it is not feasible to use batch macro to me.

Ryanz3653
7 - Meteor

  .

Ryanz3653
7 - Meteor

@Qiu 

Hi Qiu, to answer your question, yes

I have also attach a workflow screenshot for reference,

Could you provide a solution in workflow?

Thanks 

Qiu
21 - Polaris
21 - Polaris

@Ryanz3653 
Just as mentioned by @KGT We can use the unique "Workcenter" value as Control Parameter of the Batch Macro.

I have made sample as below.

0507-Ryanz3653-A.png0507-Ryanz3653-B.png

Ryanz3653
7 - Meteor

@Qiu 

Thank you very much, that was extremely helpful.

Another quick question:

For the marco input tool in yxmc file, can it be dynamic instead of text input or file input? such as sql/theobald/sharepoint list or any combination of datasource input

 

Thanks

Screenshot 2025-05-07 225358dd.png

Qiu
21 - Polaris
21 - Polaris

@Ryanz3653 
Glad to be any help.

Labels
Top Solution Authors