Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Batch Macro Passing Input to Control Parameter

Highlighted
6 - Meteoroid

My workflow uses a Append Field Tool connected to a control parameter.

On running this workflow, I expect the workflow to run N times - once for each value in the Source input to the Append Field tool - Each value being passed in a separate iteration. The source input (from the select tool) has 1 column and multiple rows and is generated dynamically.

 

However, on running the the workflow, all values in the source are getting passed at once and the workflow runs is a  single iteration. 

 

What is incorrect with my understanding of the control parameter tool ? How do I pass values to the control parameter / input tool in a manner that each value (row) is passed individually in a separate iteration ?

 

Capture.PNG

 

 

Action button config as below 

 

ActionBox.PNG

Highlighted
7 - Meteor

Hi varunrk.


Are you able to post your workflow, so we can see how we can help.


Kind regards,

Highlighted
6 - Meteoroid

Hi TSP, 

 

I need a workflow to merge 1000s of CSV files from 100 db tables into 100 files.

The files have been named as "TableName [SPACE] FILENUMBER" (Table1 01, Table1 02... Table3 04)

 

I have written a simple batch macro that unions CSV files. (Unioniser.yxmc)

 

I need to write another batch macro that can run the  Unioniser macro 100 times  and output 100 CSVs, 1 for each table.

 

My macros this far

Unioniser  

Unioniser.png

 

For the second macro that can run the above once for each Table, I can generate a listing of table names and filepaths using the directory and formula tools and further get a unique list of table names using the Unique tools as below.

 

1st  Unique tool - FilePath & FileName and Table Name

2nd Unique tool (Upper) - Table Name Alone 

Capture.PNG

 

How do I proceed further with calling the Unioniser macro one for each TableName ?

 

Highlighted
6 - Meteoroid

Thank you for your response TSP. Unable to share workflows since they give away some confidential information.

Highlighted
17 - Castor
17 - Castor

Hi @varunrk 

 

A batch macro processes all the input records once for each row in the Control Parameter.   If you have N rows in the Control parameter, your macro will iterate N times.

 

In your workflow, pass the list of fields to be changed into the Control param.  The batch will iterate once for each field in the list and change the highlighted value in the append fields tool to the current field form the control parameter

 

Dan

Labels