Alteryx Designer Desktop Discussions

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

Iterative Macro Help

J_Trusty
6 - Meteoroid

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.

5 REPLIES 5
Qiu
20 - Arcturus
20 - Arcturus

@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.

TAB.PNG

 

J_Trusty
6 - Meteoroid

.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.

ArnaldoSandoval
12 - Quasar

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

J_Trusty
6 - Meteoroid

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.

ArnaldoSandoval
12 - Quasar

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

Labels