Adding Data

In this section we will create our initial map.

Learning Objectives

  • Create a map using geographic data.
  • Use Show Me to change the currently selected type of chart.
  • Use quick calculations on measures.

The first step in creating a map is to add our data to the worksheet.

  1. Locate Country under Dimensions. Note that Tableau recognizes Country as geographic data, even though it is simply a column with country names.
  2. Drag Country onto the worksheet. This may take a moment to process as Tableau builds the initial map. Tableau will plot each data point on top of the default base map showing the countries. Worksheet canvas after adding _Country_

    At the bottom of the screen you may notice that there are 3 unknown values. We will investigate this further (and deal with the values) in the next page.

  3. While we can now see which countries have produced mods, we still want to know how many mods each country has produced. To do this we will need to add the desired measure to our worksheet. Locate mods.csv (Count) under Measures. If you have an earlier version of Tableau, this may be called Number of Records.

    Note that mods.csv (Count) is in italics, indicating that it is not information stored in one of the columns of our dataset. Instead, this is automatically generated by Tableau counting the number of records (rows) in the dataset holding each category value of the chosen dimension (in this case Country). Because each record in mods.csv is a mod, mods.csv (Count) is the same thing as number of mods, which is exactly what we want to see. Screenshots in this tutorial still contain the term Number of Records.

  4. Drag mods.csv (Count) onto the map. The country dots should change in size depending on the value.

Worksheet after adding _mods.csv (Count)_

Changing Map Type

It is very strange to me to see points (or dots) representing countries on the map. Points make perfect sense for cities, but countries are typically represented with their respective shapes, the way the base map is displaying them. To switch from circles to country shapes, click on the Show Me tab at the top right. Note that we are currently using the recommended chart symbol maps. Click on maps to the right, instead.

Change chart type to _maps_

The map should now look like this:

The new map, using shaded countries instead of dots

Because the United States has produced so many mods, it is hard to see or differentiate between many of the other country colors. If instead of the sum total number of mods we rank that sum and display each country's rank, the color shades should be much more spread out.

  1. Find CNT(mods.csv), formerly SUM(Number of Records), on the Marks shelf. (It should be right below Country.)
  2. Right click on it or hover over it and click the arrow that appears on the right.
  3. Choose Quick Table Calculation -> Rank.

Setting _CNT(mods.csv)_/_SUM(Number of Records)_ to _Rank_

The resulting map should look something like the one shown below. It is now much easier to differentiate between countries. Note that the color shades have reversed as well, with the top rank becoming the lightest.

Worksheet displaying rank instead of count