Our goal in this section is to see which tags are most popular. Each mod may have many tags associated with it, so the required data is stored in a different file in our dataset: tags.csv.
- Work with multiple data sources at once.
- Join datasets.
- Create a simple bar chart.
Multiple Data Sources
Because the tag data we want to use for our bar chart is stored in a different file, we need to know how to work with multiple data sources. Because tags.csv is in the same folder as mods.csv, this will be fairly straightforward.
- At the bottom left of the application, click on the "Data Source" tab.
- Find tags.csv below mods.csv under Files in the left section.
- Drag tags.csv onto the top section where it says: "Need more data? Drag tables here to relate them. Learn more." The exact spot where you drag it doesn't matter. This will add a tags.csv box, connected to the mods.csv box with a warning symbol.
- Tableau will now ask us to define the relationship between mods.csv and tags.csv so that it knows which row from the mods dataset holds the relevant data for a given row from tags. Because Mod ID is a unique identifier, it is the perfect choice for something like this. Choose Mod ID from mods.csv on the left and Mod ID (tags.csv) from tags.csv on the right.
- Click the X at the top to close.
Tableau will now show us the data from tags.csv, like it did when we connected to mods.csv. Many of the columns are the same as what we have seen before, but there is now a column for Tag. There are also many instances of the same mod. For example, the mod with ID 11 has multiple rows, one for each tag associated with the mod.
If you are familiar with the concept of joins, what we have done is somewhat similar. By telling Tableau how mods.csv and tags.csv are related, Tableau is now equipped to join the two tables in whatever way we need without any additional input. If you are not familiar with joins, there is no need to be, because Tableau is handling all of this behind the scenes.
Having these two tables related will allow us additional filter functionality later on. We could create our bar chart with only the data from tags.csv, but by relating that data to the mods.csv data, we can relate the bar chart we will make with our map and any other visualizations we create.
Now that we have added tags.csv, our goal is to use this data to show the top twenty tags for mods. We will start by creating a simple bar chart for all tags.
- Click the New Worksheet button on the bottom panel of the application (to the right of the tab for the Map worksheet and the left of the buttons for New Dashboard and New Story).
- Right click Sheet 2 and rename it something more descriptive, like Top Tags.
- Note how the Data sidebar has changed. Tables now has two sections, one for mods.csv and one for tags.csv. We can expand or collapse these fields by clicking the caret to the left of the file names. Right now we are interested in the data from tags.csv, so we may as well collapse mods.csv for convenience.
- Locate Tag under tags.csv and drag it onto the blank worksheet. The sheet will display a list of the various mod tags along with some placeholder text Abc.
We also want to see how many mods are associated with each tag.
- Locate tags.csv (Count). We earlier discussed how mods.csv (Count) means the same thing as the number of mods. Likewise, tags.csv (Count) means the number of tags. However, for each tag, the same mod will only ever be listed once. That is, no mod-tag pair from tags.csv will be the same as any other. This means that tags.csv (Count) provides the number of mods associated with a given tag.
- Drag tags.csv (Count) on top of the Abc placeholder text. (The column with the placeholder text will show a black outline when you hover over it with tags.csv (Count).)
- Click on the Show Me tab on the top right and choose the bar chart option. It should have a red/orange outline, which means that it is the recommended chart type.
We have a bar chart displaying the information we want - how many mods use each tag.