Alteryx Designer Desktop Discussions

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

Passing multiple inputs in Batch Macro

GaRaGe
8 - Asteroid

I am constructing a batch macro to run a set of operations in loop for a control parameter. 

 

sample input A

Itemqtsplaceid
A23MMXt6787
A11KKIt6789
A88IUJt6791
A52YTTt6793

 

sample input B

flagflag_rate
10
15
110

 

My macro basically should take these 2 inputs and runs a python code with "flag_rate" as a control parameter for each iteration and gives the final output. Since there are 3 values under "flag_rate" the macro should run 3 times and collate the results. However i do not want my input A to be changed.

How can i pass the input A without providing a groupby field?

6 REPLIES 6
patrick_digan
17 - Castor
17 - Castor

@GaRaGe You will need a control parameter mapped to flag_rate and then you can have a macro input in your batch macro that input A connects to. There is no need to provide a grouping field.

GaRaGe
8 - Asteroid

How do i map the control parameter to flag_rate?

patrick_digan
17 - Castor
17 - Castor

@GaRaGe  Good question, I would highly recommend the interactive lessons  if you haven't already checked them out. 

 

I've put together a simple example with your sample data. 

 

patrick_digan_0-1612531238772.png

 

The flag_rate is being mapped on the questions tab:

 

patrick_digan_1-1612531267501.png

 

 

GaRaGe
8 - Asteroid

Thank you very much for this. very useful

 

Does this work for a dynamic input A? because i extract the data from a DB that updates constantly and then i should run the macro over it with flag_rate as control parameter

GaRaGe
8 - Asteroid

Also why do i get this parse error in the solution you provided?

 

GaRaGe_0-1612769801500.png

 

patrick_digan
17 - Castor
17 - Castor

Hi @GaRaGe This would be allow for a dynamic Input A.

 

As for the flag rate error, I'll just walk you through how the macro is working exactly. 

 

In my macro, when I placed the control parameter on the canvas, I renamed it to flag_rate here in the Name box at the top:

 

patrick_digan_0-1612801217923.png

 

Now when I click on the canvas and then the workflow >>> configuration tab, I can give flag_rate a "test value" of 5:

 

patrick_digan_1-1612801323747.png

 

Now I can use that control parameter variable in my formula tool:

 

patrick_digan_2-1612801366496.png

When I click run in my macro, it will run my test value through (5). When I go back to my workflow and click run, it will run through the values from the dataset. FYI this method is called reference shortcut. Note that if you're in a macro and copy/paste an interface tool, it loses it's name. 

 

 

 

Labels