Looping through a list, creating a separate report for each value
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I'm new to Alteryx and I think this is a simple question, but I'm just not seeing any answers in the knowledge base or elsewhere on the community pages.
I have two files, one is a list of "Org ID". The other file contains data, and one of the columns in the data is Org ID.
I need to pull the data from the second file and append it to an excel template for each "ORG ID" value.
I'm just looking for a simple example on how I would best do this.
I've looked at iterative, and batch macros, but I'm just not sure how they work, or if they are overly complex for what I'm trying to do in this case.
By the way, this is just made up sample data, in reality I will be pulling from a Teradata database.
I've got that part figured out. I was able to pull all the data, and export it to Excel.
I just can't seem to figure out how to loop through my ORG ID list and create a separate report for the data for each ORG ID
Any help would be much appreciated.
Solved! Go to Solution.
- Labels:
- Developer Tools
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
There's a few ways you might produce separate reports depending on what you would like those reports to look like. Macros can be very helpful in processes like this (a batch macro would be appropriate here), but are not always necessary.
I've attached a simple example that matches the Org_ID values from each input and outputs an Excel file with each Org_ID on its own sheet. This is achieved by the "Take File/Table Name From Field" feature of the Output tool.
Let me know if this works for you, or if you're looking for something else in reporting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks CharlieS
The output needs to append to separate files, but I think I can figure that part out.
This got me over the hurdle of separating them.
It definitely sounds like Batch Macros will be a great tool to learn, but this should work for now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
CharlieS,
I thought I could figure out the Batch Macro, so I can put these in separate files for each ORG_ID.
I was wrong.
Could you please look at the attached, and point me in the right direction?
I think I'm just missing some key concept on configuring the Control Parameter tool, but I'm just not seeing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Since you have an external list of Org_ID values you'd like to batch on, use a Summarize tool to create a unique list of those values and that will be fed into the Control parameter for your batch macro. Inside the batch macro, use the Control Parameter tool to update a filter so only those records are processed. Then the Formula and Output tools are the same as before.
Check out the attached workflow package for an example that includes this batch macro in action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Just got a chance to get back to this today.
Yes, this will work.
Thank you.
![](/skins/images/18F3BF3EB54AD3C2739B5AA9B77A7F97/responsive_peak/images/icon_anonymous_message.png)