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
Line1 | U001 | 2 | 5 | 6 |
Line1 | U002 | 3 | 4 | 7 |
Line2 | U003 | 5 | 6 | 9 |
.....
Output:
Workcenter Metric Stat Value
Line1 | Metric_A | Min | 2 |
Line1 | Metric_A | Avg | 3.0 |
Line1 | Metric_A | Max | 5 |
Line1 | Metric_B | Min | 4 |
Line1 | Metric_B | Avg | 4.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
Solved! Go to Solution.
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.
@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.
.
Hi Qiu, to answer your question, yes
I have also attach a workflow screenshot for reference,
Could you provide a solution in workflow?
Thanks
@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.
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
@Ryanz3653
Glad to be any help.