Creating custom territories

Tableau 10 allows geographic regions to be selected and grouped, hence creating custom territories.

In this recipe, we will explore this option:

Creating custom territories

Getting ready

To follow this recipe, open B05527_05 – STARTER.twbx. Use the worksheet called Custom Territories, and connect to the Worlds Busiest Airports data source:

Getting ready

How to do it...

The following are the steps to create the custom territories in this recipe:

  1. Double-click on the Country field under Dimensions in the side bar. The double-click action places this field in the Details property and creates a map with dots that represent the country of the respective airports, as well as the built-in Latitude and Longitude fields to Rows and Columns respectively.
  2. Press Ctrl + drag the Latitude (generated) pill in the Rows shelf to the Rows shelf, to the right of the existing pill, to make a second copy. This will generate a second map in the view:
    How to do it...
  3. Click on the first Latitude (generated) field to activate its Marks card, and change the mark type to Filled Map.
  4. For the top map, use the lasso tool from the view toolbar to select all the filled areas in the Americas:
    How to do it...
  5. While these countries are selected, the command buttons will appear. Click on the paperclip to group these countries as a single territory:
    How to do it...
  6. Using the previous step as reference, create territories for three more groups of countries, as shown in the following screenshot:
    How to do it...
  7. In the Dimensions section in the side bar, rename the Country (group) field to Custom Territories. You can do this by right-clicking on the field, and selecting Rename:
    How to do it...
  8. Right-click on the values that appear in the color legend, and select Edit Alias. Change the aliases to the corresponding territories:
    How to do it...
  9. Change the title of the color legend to Custom Territories. You can do this by clicking on the drop-down arrow in the top right corner of the color legend and selecting Edit Title.
  10. Activate the second Marks card by clicking the second Latitude (generated) pill in the Rows shelf.
  11. While the second Latitude (generated) Marks card is active, change the mark to Circle.
  12. From Measures, drag Passengers to Color in the second Marks card.
  13. Right-click on the SUM(Passengers) pill, and in the Measure option, select Average instead of Sum.
  14. Edit the color of the passenger color legend. Change it to Stepped Color, with four steps:
    How to do it...
  15. Click on the drop-down arrow on the second Latitude (generated) pill in the Rows shelf and check Dual Axis:
    How to do it...

How it works...

Tableau 10 has a new feature that allows us to create custom territories. To create custom territories, we simply need to select all the marks in the map we want to include in the territory, and then using the paper clip icon to create the territory:

How it works...

You may recall that the paperclip icon normally groups items together. The custom territory tool uses the same concept.

Instead of using the paperclip icon, you can also choose to right-click on the geolocation field on the side bar and use the menu items to group the locations:

How it works...

Once you create the group, you will notice a new field in the side bar represented by a globe with paperclip icon:

How it works...

To make modifications, you can right-click on this new field and select Edit. In the Edit window, you can rename the groups or rearrange the members of the group as needed:

How it works...

There's more...

We can add a lot of insights to maps by creating dual axis graphs – two marks on top of a map. To do this, we can simply duplicate either (or both) the latitude or longitude pill on either the Rows or Columns shelf and change the mark of one of the pills.

In the following example, we have a filled map with circle marks. To achieve this, we duplicated the latitude pill by using the Ctrl + drag shortcut from the pill to the Rows shelf. This produces two pills on Rows and two maps on the view, one on top of the other. This also introduces three Marks cards—one for the first pill, one for the second pill, and another one called All, which will affect both maps:

There's more...

Because we have multiple Marks cards, we can now vary the marks we want to show. To overlay one map on top of the other, we can simply right-click on the second Latitude (generated) pill and select Dual Axis:

There's more...

Pies on map? Shapes on map? Circles on map? All of these can be done using this technique!

See Also

  • Please refer to the Creating a combo chart (dual axis chart) recipe in Chapter 2, Advanced Charts
  • Please refer to the Using path to display movement in map recipe in this chapter
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.246.223