Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Mapping: Generate Multiple Maps Automatically Using the Grouping Field

DanC
Moderator
Moderator
Created

 

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 (illustrationbelow):

  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 separate 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!

Attachments
Comments
RogerNorthup
6 - Meteoroid

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.

DanC
Moderator
Moderator

Hi @RogerNorthup,

 

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!

BPurcell2
9 - Comet

@DanC & @RogerNorthup

 

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.

Paulteryx
11 - Bolide

One thing to consider with the Group By Function in the Report Map tool is that you want to choose the layer with the largest level of granularity in your spatial data to reflect in the map. For example, if you are bringing in a polygon spatial object and grouping by that, you do NOT want to group by your points as well. This will result in extra maps focusing on the group by items in the points in addition to the polygons. The largest level of granularity you want to see in your data in this case is the polygon, and therefore should be the only data that has a Group By field selected.