Alteryx Designer Desktop Discussions

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

Batch Macro to Iterative Macro

Akdashboard
6 - Meteoroid

Hello - I have a batch macro that I think I need to convert an iterative macro. It works well as a batch macro to create numerous individual outputs, but I now need to create 1 single output with columns added each time the macro runs.

 

Business Case: I am have a bunch of IDs for data sources and dependent IDs that tell me if a given data source sends data to another data sources. My batch macro outputs all the downstream data IDs, but now I want to make a single file with all possible IDs in column 1, then each column after that representing another single ID as the header and then populates a value if that ID is downstream for the ID in Column 1. 

 

Example:

All IDs123456789
987123456789
654 456789
321123 789

 

In this table I know that all 3 IDs (123, 456, 789) send data to 987. 456 and 789 send data to 654. 123 and 789 send data to 321.

 

I have a process that does this if I run the flow one-at-time for each possible ID, but that is 3000+ so doing it manually isn't really an option.

 

Thoughts?

3 REPLIES 3
Qiu
20 - Arcturus
20 - Arcturus

@Akdashboard 
I am sorry but I am bit confused here.
eventually you want to create a single Excel file as output, and each ID (987, 654, 321) as Sheet Name?

Akdashboard
6 - Meteoroid

@Qiu 

Not separate sheets, but separate columns. 

 

My workflow has 2 parts.

  1. Part 1 does a series of joins and other formatting that identifies all dependant IDs for the ID being ran. 
  2. Part 2 (the area I need help) opens an Excel file with all possible unique IDs in column 1, then takes the output of part 1 and creates a new column that populates a value (the ID that was ran, to be specific) if the ID in column 1 is identified as a dependency in the output of part 1. Then re-saves (overwrites) the initial Excel file. This way, when the flow is ran again with a different ID, a new column is created in the same way and the Excel file is saved and overwritten again.  

Using my grid example, the first time the flow was ran for ID 123, the Excel file is loaded and only had the column 'All IDs'. When it finished, it had the column 123, with values next to 987 and 321 (indicating that both are dependencies of 123). The next time the flow was ran for 456, the Excel loads with 2 columns, All IDs and 123. When the flow finished, it has the column 456 added. Then the flow was ran a third time for ID 789 and when the Excel file loads, it has 3 columns, All IDs, 123 and 456. Then when it finished, it has the column 789 added.

 

Example:

All IDs123456789
987123456789
654 456789
321123 789
nushh
7 - Meteor

were you able to solve this? I'm trying to solve something similar.. and would like your help

Labels