Step 4: Explore your data geographically

You've built a great view that allows you to review sales and profits by product over several years. And after looking at product sales and profitability in the South, you decide to look for trends or patterns in that region.

Since you're looking at geographic data (the Region field), you have the option to build a map view. Map views are great for displaying and analysing this kind of information. Plus, they look great!

For this example, Tableau has already assigned the proper geographic roles to the Country, State, City, and Postal Code fields. That's because it recognised that each of those fields contained geographic data. You can start creating your map view right away.

Learn more: Meet geographic roles

Tableau recognises a lot of common geographic data, such as state and city names. When Tableau recognises this type of data, it automatically assigns fields appropriate geographic roles, so they become geographic fields.

Geographic fields have globe icons next to them in the Data pane. If a field is assigned a geographic role, Tableau automatically creates a map view when you add the field to Detail on the Marks card. More on that later.

If Tableau doesn't recognise your data as geographic, you can manually assign a geographic role to each of the relevant fields.

There are several geographic roles to choose from:

  • Airport
  • Area Code
  • City
  • Congressional District
  • Country/Region
  • County
  • NUTS Europe
  • State/Province
  • Zip Code/Postcode

To see this in action, watch the animation below.

Click the image to replay it

Build a map view

Start fresh with a new worksheet.

  1. Click the New worksheet icon at the bottom of the workspace.

  2. Tableau keeps your previous worksheet and creates a new one so that you can continue exploring your data without losing your work.

  3. In the Data pane, double-click State to add it to Detail on the Marks card.

  4. Ta-da! You’ve got a map view.

    Click the image to replay it

    Learn more: Double-click to add geographic fields

    You can double-click fields to quickly add them to the view. When you double-click a geographic field specifically, it's automatically added to Detail on the Marks card, and a map view is created with marks for each location listed in the field.

    Since Tableau already knows that state names are geographic data, and because the State dimension is assigned the State/Province geographic role, Tableau automatically creates a map view.

    There is a mark for each of the 48 contiguous states in your data source. (Sadly, Alaska and Hawaii are not included in your data source, so they are left out.)

    Notice that the Country field is also added to the view. This happens because the geographic fields in Sample - Superstore are part of a hierarchy. Each level in the hierarchy is added as a level of detail, like layers of an onion.

    Additionally, Latitude and Longitude fields are added to the Columns and Rows shelves. You can think of these as X and Y fields. They're essential any time you want to create a map view, because each location in your data is assigned a latitudinal and longitudinal value. Sometimes the Latitude and Longitude fields are generated by Tableau. Other times, you might have to manually include them in your data. You can find resources to learn more about this in the Learning Library.

    Now, having a great-looking map focused on 48 states is one thing, but you wanted to see what was happening in the South, remember?

  5. Drag Region to the Filters shelf, and then filter down to the South only. The map view zooms in to the South region, and there is a mark for each state (11 total).

  6. Now you want to actually see how your data shapes up for this region, so you start to drag other fields to the Marks card:

  7. Drag the Sales measure to Colour on the Marks card.

    Click the image to replay it

  8. The view automatically updates to a filled map, and colours each state based on its total sales.

    Any time you add a continuous measure that contains positive numbers (like Sales) to Colour on the Marks card, your filled map is coloured blue. Negative values are assigned orange.

    Sometimes you might not want your map to be blue. Maybe you prefer green, or your data isn’t something that should be represented with the colour blue, like wildfires or traffic jams. That would just be confusing!

    Don’t worry, you can change the colour palette just as you did before.

  9. Click Colour on the Marks card and select Edit Colours.

  10. For this example, you want to see which states are doing well, and which states are doing poorly in sales.

  11. In the Palette drop-down list, select Red-Green Diverging and click OK. This should allow you to quickly see the low performers and the high performers.

  12. Your view updates to look like this:

    But wait. Everything has just turned red! What happened?

    The data is accurate, and technically you can compare low performers with high performers, but is that really the whole story?

    Are sales in some of those states really that terrible, or are there just more people in Florida looking to buy your products? Maybe you have smaller or fewer stores in the states that appear red. Or maybe there’s a higher population density in the states that appear green, so there’s just more people to buy your products.

    Either way, there’s no way you want to show this view to your boss because you aren't confident the data is telling a useful story.

  13. Click the Undo icon in the toolbar to return to that nice, blue view.

  14. There’s still a colour problem. Everything looks good – that’s the problem!

    At first glance, it appears that Florida is performing the best. Hovering over its mark reveals a total of 89,474 USD in sales, as compared to South Carolina, for example, which has only 8,482 USD in sales. However, have any of the states in the South been profitable?

  15. Drag Profit to Colour on the Marks card to see if you can answer this question.

  16. Now that’s more like it! Since profit often consists of both positive and negative values, Tableau automatically selects the Orange-Blue Diverging colour palette to quickly show the states with negative profit and the states with positive profit.

It’s now clear that Tennessee, North Carolina, and Florida have negative profit, even though it appeared they were doing okay, or even great, in Sales. But why? You'll answer that in the next step.

Check your work! Watch "Build a map view" in action

Click the image to replay it

Continue to Step 5: Drill down into the details.

Thanks for your feedback!