Alteryx Designer Knowledge Base

Definitive answers from Designer experts.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here

Customize a Thematic Legend

Alteryx
Alteryx
Created

Those of you who have used the Report Map tool to create thematic maps have likely been unimpressed with the way Alteryx outputs the thematic legend text. Alteryx added two little known/used tools: the Map Legend Splitter and Map Legend Builder. With a little finesse, you can get the legend to go from completely unformatted to fully customized.

 

Before

After

 Legend_Before.png

 Legend_After.png

 

Not only does this allow for an easier to read the legend, but it also can save valuable space on your map or document. The example above simply involves taking the default thematic output legend text and replacing it with user-defined text for those layers.

 

Here's How You Do It 

 

The entire workflow is illustrated after all of the steps below.

  1. In the Report Map tool on the Legend tab, change Position to "Separate Field". This will output the map and legend as separate objects, allowing you to work with just the legend.

    Select Seperate Field.png

  2. Add two Select tools after the map. In the first Select tool, select only the legend. In the second, only the map (and BoundingRect, if needed).

  3. Add the Map Legend Splitter tool after the Select tool that selects the legend, and select "Legend".

  4. Add a Record ID tool which will be used later to re-sort the legend back to its original order.

  5. Add a Filter tool using the [ThemeName] field in order to extract just the records which make up the thematic part of the legend. For this example: [ThemeName] = “Block Groups”.

  6. Create a Lookup table containing the Record IDs and the new text for the legend rows that you want to replace.

    Lookup Table.png

  7. Join the lookup table to the legend stream using RecordID. Deselect the original “Text” field and rename the “NewText” field to “Text”. Deselect the second RecordID.

    Join.png

  8. Union the new modified legend rows back with the non-modified legend rows using “Auto Config by Name”.

  9. Sort the records back to their original position.

  10. Use the Map Legend Builder to rebuild the new legend. The default configuration is all that is necessary.

From this point, you can choose to either overlay the legend on the map (using the Overlay tool), or join the legend back to the map (using “Join by Record Position” in the Join tool) and position the legend adjacent to the map as desired using the Layout tool.

 

Below is the entire workflow numbered by the steps above. Attached is a sample workflow created in 10.0.

 Workflow.png

Attachments