Unit 3: Part 1 - Visualizing Data in Tableau

Unit 3: Part 1 - Visualizing Data in Tableau♦ USGS Water Use data, an overviewObtaining the data & spreadsheet etiquette♦ Exercise 1: Water Withdrawal by Category, Type, and Source1a. Loading data into Tableau1b. Joining tables♦ Navigating Tableau♦ Working with worksheetsThe Data pane:1c. Constructing a visualization■ Organizing our data■ Plotting our data♦ Challenge ♦:1d. Derived fields: Plot per capita water withdrawals.Exercise 2: Mapped data with Tableau2a. Organizing the data2b. Filtering and changing the plotted data♦ Challenge ♦Exercise 3. Pie Charts. StepsExercise 4. Bar charts by state and categorySteps:Exercise 5: Plot only the top 10 statesDashboardsStoryboards

Here, we test drive Tableau with some water use data pulled from the USGS servers. We'll examine how to get data into a Tableau session, how to best organize our data, and how to construct various plots and charts with our data. We'll also examine Tableau's "dashboard" and "storyboard" features.


♦ USGS Water Use data, an overview

The USGS collects and reports water use on 5-year intervals. The latest data released was from 2010. Go to the USGS Water Use website (https://water.usgs.gov/watuse/). Notice they provide some overviews of the data. Click on the different overviews. What do you notice? Is this information helpful? Would this information be more engaging if we could explore different state water use?

Obtaining the data & spreadsheet etiquette

From the USGS website, download the state data for 2010.

This is a frequent problem with water data. You might be able to discover the data, but the data are not in a format that is immediately usable. How would you reorganize the data to be more usable?

While this latter format is better suited for data analysis, we have further modified it to provide a good working example for learning Tableau. This is saves as the file called State_Data_Formatted.xlsx.


♦ Exercise 1: Water Withdrawal by Category, Type, and Source

We'll start exploring Tableau's analysis environment by making a simple plot with our water use data. Specifically, we'll construct a simple stacked bar plot of water withdrawals by category, limiting our data to fresh water withdrawals only. In doing so, we'll cover some basics such as: reading data in, joining tables, setting up plots, and manipulating plots.

Then we'll see if we can mimic some of the USGS' exploratory products.

 

1a. Loading data into Tableau

Tableau accepts several data formats, including Excel spreadsheets. You can also connect to remotely served data such as Google Sheets. However, to keep it simple, we'll just load in our local Excel spreadsheet.

 

1b. Joining tables

We want to connect data in our WaterUse worksheet with the data in the Population worksheet. We do this by joining the two tables.

Data Source


♦ Navigating Tableau

The bottom row of the Tableau workspace contains tabs for the different objects you've created as well as links to create new objects.

 

♦ Working with worksheets

TableauWorkspaceWorksheets

The Data pane:

1c. Constructing a visualization

■ Organizing our data

Let's begin our visualization exercise by plotting fresh water withdrawals by water use category. The first step in doing this is structuring our data into a table that computes the sum water withdrawal for each category (e.g. Aquaculture, Irrigation, etc.) and for each type (Fresh vs Saline). Let's explore how this is done in Tableau.

 

 

■ Plotting our data

As we configure the way the data are shown in our sheet, you will noticed in the "Show Me" area on the left, Tableau recommends different plotting options, with its top recommendation given a red border.

StackedBarPlot1

It's a little hard to see - what if we flipped the orientation...

StackedBarPlot1

Notice that Total is making the Withdrawal axis very long. Remove the Total column.

→ At present our plot's name is "Sheet1". Renaming the sheet will rename the plot...

Bar Chart


♦ Challenge ♦:


1d. Derived fields: Plot per capita water withdrawals.

Bar Chart


 

Exercise 2: Mapped data with Tableau

Let's explore more of Tableau by attempting to recreate the USGS figure shown here:

USGS Fig 1

2a. Organizing the data

 

Map

2b. Filtering and changing the plotted data

► Let's only look at freshwater totals.

►How does the fresh water map change if you look at per capita withdrawals?

Map


♦ Challenge ♦

Create a plot, in a new/different sheet, showing which states use the most groundwater per capita. Add the actual per capita withdrawal value by dragging the appropriate field on the "Label" box in the Marks shelf:

Exercise 2 Figure


 

Exercise 3. Pie Charts.

Next, we'll tackle the pie chart shown here:

Pie

Steps

pie

Some modifications:

What other charts might convey this information better than a pie chart?


Exercise 4. Bar charts by state and category

Our next Tableau exercise aims to replicate this plot of geographic distribution of water use by category published by the USGS (source):

USGS Bar chart

Steps:

If you look at the USGS figure, the states are sorted from west to east. We could replicate this by sorting our states based on longitude. We have longitude as a calculated field, but alas, it cannot be used to sort our data. Nor can it be set as a dimension, or even extracted into a non-calculated field. So close... but this is why we might use scripting - to get beyond the limitations of GUI-based plotting applications...

Still, we'll take a quick look at sorting columns and rows to see how it could be done...

 

Exercise 5: Plot only the top 10 states

State Bar


Dashboards

Now that we've created the data visualizations, we can organize the visualizations onto a dashboard.

Dashboard


Storyboards

A storyboard allows you to merge together multiple dashboards or charts to progressively lead a reader through a process of understanding their data.

Storyboard is similar to the dashboard, except you can also include dashboards. Each caption box at the top represents an html page. Arrange your plots and captions, add text, and tell a story about the data. Here's one example:

 

Story board


END