community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.

Mapping: Generate Multiple Maps Automatically Using the Grouping Field

Moderator
Moderator
Created on

 

The Task

I remember vividly many years ago when I was tasked by my former boss at a previous company to create trade area maps for each one of our office supply stores. At the time, we had roughly 1,200 stores. I only had MapInfo to work with and no programming skills to fall back on. Needless to say, I was a little distraught. 

 

It didn't take me long to realize that this feat, as far as I was concerned, could not and would not be completed manually. So, a crash course in MapBasic programming was in order. After a lot of studying, a fair amount of pain and hours upon hours of struggle, I was able to create a MapBasic program that would produce these maps in an automated fashion.

 

Fast forward 4 years and something amazing happened – I was introduced to Alteryx!

 

After significantly less studying, pain and struggling, I was able to create a workflow which could to do the same thing, except this time produce three map views for each store. Not only was I able to create the workflow without programming, saving me countless hours, Alteryx produced each map in significantly less time. So, I would run the workflow before leaving for the day and come back in the morning with the nearly 4,000 PDFs waiting for me! We then decided to produce two additional thematics for each store, so now we are talking nearly 12,000 maps. You can only imagine the time savings!

 

How is this done?

The attached workflow (shown below - created in 10.1) is the basis for doing just that. The Grouping function within the Report Map tool (also shown below) is all that is required to create this automation. In this workflow, I want to create a map for each store with each store’s 15 minute drive time and customers. I also want all of the competitors to show up no matter which store is shown.

In order to achieve this, I have simply configured the workflow so that the store number is in the Grouping Field for the first three layers previously mentioned, and left the Grouping Field blank for the competitors layer.

 

Workflow.png

 

ConfigurationExample.png

 

 

Want a separate file for each map?

In the Render Tool (illustration below):

  1. Make sure to choose a specific output file type in the Output Mode
  2. Choose a name and location for the files
  3. Check the 'Group Data into Separate Reports' box
  4. Select the field to group on (typically 'Group')
  5. Choose how you want to modify the file name for each map

 

RenderConfig.png

 

As a result, you will see a file created for each map:

 

Results.png

 

 

Requirements:

  • Each layer must have a common field (Store Number in this case).
  • The Field type of the common field to group by must be the exact same (Int16 in this case) - No mixing of Int16 with Int64 or V_String with String, for instance.

Things to Consider:

  • Only one object from each of the layers that you are grouping by will show up on each map (unless you have multiple records with the same ID). So for example, other stores will not show up on the same map, even if they are within the map view. You can add these in as a seperate layer and not group it if you want those within the map view to show up on each map.
  • Zoom to layer – Select appropriate layer to zoom to in each map (drive time boundary in this case).
  • A field called ‘Group’ will flow through the workflow after the Report Map tool, which you can use for map titles, for example.

 

Please feel free to comment or ask questions, and thanks for reading!

Comments
Atom

One thing I learned from trying this, which I desperately needed, is that it seems like the grouping field needs to be some sort of value.  I tried to group with String fields that were number and it didn't like it.  But when I converted the strings to Integers, it worked fine.

Moderator
Moderator

Hi @rnorthup,

 

Thanks for your comment. I did a simple test with a string as the grouping field and it worked for me. The only thing that would cause an issue for me is if I was grouping multiple layers and the field types were different.

 

Thanks!

Asteroid

@DanC & @rnorthup

 

I had the same issue attempting to create a powerpoint for each state using the reporting tool.  I brought in my states from the Allocate tool.  Initially, I tried joining on the State, but it didn't it said the grouping fields must be the same data type.

 

I converted the fields to an int with a record id, and it ran.  I'm using 11.0

 

Thanks.