Alteryx Designer Desktop Discussions

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

Batch Macro different output files

omkarshinde
8 - Asteroid

Hey, is there a way to get each parameter passed into control parameter to different file output?

currently all records of batch macro are being collated into a single file however i want different file outputs every time a parameter is passed into the control parameter!
I cant use the workflow method mentioned because i am using dynamic filter to update my filter values via macro.
Therefore I cant attach file tool to the update value tool because I have already attached filter tool to it.Capture.PNG

18 REPLIES 18
binuacs
21 - Polaris

@omkarshinde You need to use the output tool inside the batch macro and save the file based on the parameter value

PhilipMannering
16 - Nebula
16 - Nebula

I would create the FilePath outside the macro (presumably the filename is based on the parameter values used in the macro), pass it in and have the Output Data Tool update based on field values.

omkarshinde
8 - Asteroid

I already tried doing this however only one iteration is run containing all the records!Capture.PNG

omkarshinde
8 - Asteroid

exactly can u tell me how do i use file output inside the macro because as i mentioned my change value via control parameter is already being used for dynamic filter so I dont know how do I add file tool now to it via control parameterCapture.PNG

binuacs
21 - Polaris

@omkarshinde If you want to reflect the control parameter you are using in the filter tool to the output tool, connect the same control parameter to the output tool and update the action tool settings. An example give below

image.png

omkarshinde
8 - Asteroid

I tried to do what you suggested but I have two update values(consider city and state) in my batch macro via the same control parameter and when i connect the third update value to the file tool via the same control parameter i want the file names as city_state every time a new city and state is passed. So i tried to bring city and state together via formula tool however I am facing difficulty in putting together all of this.

Can you take example of city and state control parameters and explain further please?.

 

binuacs
21 - Polaris

@omkarshinde would you be able to provide some sample data and based on your requirement also the expected output?

omkarshinde
8 - Asteroid

Capture1.PNG
I want to create multiple file outputs for every row of city and state. example:there are 3 unique combinations of city and state above so my main dataset should be filtered for these 3 combinations and 3 files should be created dynamically named city_state. 

The main dataset to be filtered woould look something like this below.
Capture2.PNG

 

Note: I have already tried creating batch macros for same but it just collates all of my output records into single file instead of multiple files as required.

binuacs
21 - Polaris

@omkarshinde For your use case I don't think you need batch macro, in a formula tool and create a file path with the city and state name (concatenated) then in the output tool update the file path variable. Attaching a sample workflow for your reference

 

image.png

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels