Iterative Macro Help
- 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
Hello! I need help creating a macro to iterate through a list and save out files.
I have a MapInfo .TAB file that is a bunch of geographic boundaries. One of the columns is CBSA Market name. I want it to selected all the boundaries with the same CBSA Market name and save those out in a file named what that CBSA market it. Then iterate through the entire list of markets?
My idea export would be a bunch of .TAB files one for each market named the market name.
I've never created a macro before in Alteryx.
- Labels:
- Iterative Macro
- Macros
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@J_Trusty
If you can provide a sample file maybe we can take a closer look.
This is the first time I heard about Tab file, but I doubt that Alteryx can output file in the format of .TAB as you mentioned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
.tab is the 4th from the bottom in the middle section. ( MapInfo Professional Table .tab ).
Here is a sample set of the data. There is a column called "DMA" and that has almost 50 unique values throughout the sample set. I want an exported out file for each of the unique values that has selected the all that match it. I am not opposed to having another file that has all the unique values listed for the list to iterate through.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @J_Trusty
I loaded MapInfo file you supplied, the attached workflow loads it and generate some summaries, but I did not understand what you want. Anyhow, I attached the workflow.
hth
Arnaldo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello! Thanks, that is where I currently had my workflow set, but I want it to iterate through all 49 records ( from the unique tool ) and save out 49 files one for each of the 49 unique DMA_ID.
So, in your example when 807 saved out, it has the 157 records. When it saves out 501...that will have 202 records in it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @J_Trusty
You don't need a macro to create those 49 files, the only drawback is that Excel does not support Spatial data types, so that field is missing in the Excel files, that's the reason the workflow generated YXDB files, which support Spatial data types.
This community topic Spatial Objects not shown in .xlsx files explains the issue writing Spatial data types to Excel and provides a workaround.
hth
Arnaldo
![](/skins/images/D34B41DA407DC996E7BFF253AD24F7E2/responsive_peak/images/icon_anonymous_message.png)