Free Trial

Alteryx Designer Desktop Discussions

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

Output Data In Iterative Macro

sidatm
6 - Meteoroid

Hi Everyone,

 

I have written iterative Macro that's being called after reading a data base for each row. I want to be able to write output of each iteration in a single file in append mode. however, each iteration overwrites the output data file. How do i append output of each iteration in a single file?

6 REPLIES 6
Peachyco
11 - Bolide

You might try these steps:

  1. Load the existing data from the file into the workflow/macro, maybe using the Input Data Tool.
  2. Append your new data to that existing data, ending up with an updated dataset.
  3. Overwrite the file with your updated dataset (which is now the combination of the old data and the new data).
sidatm
6 - Meteoroid

Thanks for the response.

please see the screenshot of my flow. i am using select tool to select 2 coloumn (Id, ResponseCode). Where do i put append field to append new data with existing data?

 

 

Peachyco
11 - Bolide

@sidatm You can use the Union Tool to bring them together before sending to the Output Data Tool, like so:

Alteryx - sidatm Output Data.png

sidatm
6 - Meteoroid

Thanks. This works however i had to create blank file dynamically. Can i create this file on the dynamically?

Peachyco
11 - Bolide

You can use the Formula Tool to dynamically generate the file name (or preferably, the absolute UNC path to avoid errors/confusion) - that is, if you don't already have the desired file name/path from some other source:

Alteryx - sidatm Output Data a.png

For the output, you can configure the Output Data Tool to use the file name/path that you specify:

Alteryx - sidatm Output Data b.png

And for reading a file with a dynamic name, you can use the Dynamic Input Tool:

Alteryx - sidatm Output Data c.png

sidatm
6 - Meteoroid

Sorry i was not clear in my question. The original solution that you provided, when we execute the workflow, Input data already expects that a file exists so i have to create a file manually before executing the workflow. Can workflow itself create a blank file with header? please see Yellow highlighted in the screenshot.

Labels
Top Solution Authors