tableau tutorial -...

22
VU Visualization Kralj Christoph - 1 - Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data exploration and creation of awesome interactive visualizations. Here are two examples: https://www.freakalytics.com/tdwi-11-9/ http://vizcandy.blogspot.co.at/2013/07/replicating-new-york-times-d3js-chart.html

Upload: others

Post on 14-Mar-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 1 -

Tableau Tutorial

Motivation

Why Tableau? Because it provides smart ways for data exploration and creation of awesome interactive visualizations. Here are two examples:

https://www.freakalytics.com/tdwi-11-9/

http://vizcandy.blogspot.co.at/2013/07/replicating-new-york-times-d3js-chart.html

Page 2: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 2 -

Data

In this tutorial we are going to use Tableau to investigate crimes in Chicago. The data can be found here: https://data.cityofchicago.org/Public-Safety/Crimes-2001-to-present/ijzp-q8t2. We add a filter Year is 2015:

and export it as csv or csv for Excel:

Importing data

Page 3: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 3 -

Open Tableau and Connect to data:

On the left we choose In a file -> Text File (for csv files) and open the downloaded csv file

You see the dataset and how Tableau thinks the columns should look like:

Page 4: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 4 -

The first column is “ID,case” which is not correct. To correct this hover over Crimes_-_2001_to_present.csv at the top and click on the gear:

Page 5: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 5 -

The following dialog opens and we change: FieldSeparator to Comma Text Qualifier to “ and the Locale to English (United States).

Principal examine the dataset with a editor of your choice to see how the data is formatted and chose the options in this dialog dependent on this information. Eg. our data is from US which means we have to change the locale. The columns look correct and we can Go to Worksheet:

Page 6: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 6 -

Overview Here are all data sources used in this workbook. It is possible to use different datasets in one Workbook. The Dimensions contain categorical data and create tags.

The Measures contain quantitative data and create axis.

Page 7: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 7 -

Creating an interactive bar Chart Let us examine where most of the crimes happen! Step 1 – Bar Chart Drag the Location Description to the Rows and the Columns.

We want to know how many crimes happened. To achieve this we need to change the Column to measure Count. Click on Location Description -> Measure -> Count

Page 8: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 8 -

Create now a new sheet by clicking on the bottom at add and create your own graph with the existing data. Like how are the primary types distributed or which month is the savest.

Step 2 – Calculated Field Let create a measure for the Location Description Count. Right click into the Measures area and Create Calculated Field…

Page 9: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 9 -

Give the measure a name (is use LDC) and add as Formula COUNT([Location Description]).

Page 10: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 10 -

You may use this in the columns instead of the current one and we use it to create a filter. Drag the created measure into the Filters area and choose a range of values. You may change the filter anytime by rightclickin the measure in the Filters area. To increase the interactivity we enable the Quick filter. Right click on the measure and Show Quick Filter.

On the right side is now the Quick Filter! Again improve your own sheet by adding a calculated field and/or a filter to improve the visualization. Step 3 - Sorting Let’s sort the rows by the count. By hovering over the row description you can see the sort symbol. Clicking on it will sort it alphabetically.

Page 11: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 11 -

Click on Location Description in the Rows area and there on Filter.

In the Dialog change Sort by to your created measure.

Page 12: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 12 -

Step 4 - Appearance Clicking on Color in Marks lets you change everything around colors.

Drag your created measure onto the Label area in the Marks area to show the numbers.

Page 13: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 13 -

Step 5 - A lot (too many?) colors Drag the Primary Type onto the Color area. Tableau creates fpr each category in Primary Type a color code.

There are too many entry’s and color may be a bad channel to visualize this variable. Arrest seems to be a better choice.

Page 14: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 14 -

When you click on Arrest -> Edit Colors you can change the color set.

Page 15: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 15 -

Choose a color set!

At this point again think about your own sheet!

Page 16: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 16 -

Step 6 - Creating a Dashboard We create a dashboard by clicking on the add dashboard button.

Drag both sheets into the area on the right side and arrange them in a nice way. At the moment you change the original sheet, also the sheet in the dashboard will be updated. By double clicking on a sheet title in the dashboard you may change the name. My dashboard:

Page 17: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 17 -

Let us add some interactivity to the dashboard; Global Filters. Go to Dashboard -> Actions…

Click on Add Action > and add a Filter like this:

Page 18: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 18 -

This enables the functionality to select something in the first sheet and the second sheet is filtered the same way. Create now your own action(s)! Which location do you think is the “safest”? Here are two examples in respect to the actions:

Page 19: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 19 -

Creating a Map Tableau provides an easy way of plotting spatial data (longitude/latitude). Download from https://www.tableau.com/public/gallery/forest-fire-hot-spots the workbook.

Page 20: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 20 -

Open it and create a new sheet. Drag and drop Latitude and Longitude from measures into columns and rows. It should look like this:

Now select the all the lower point and click on Keep Only.

Page 21: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 21 -

Let us use the color as channel for the Fire Size Class. Drag Fire Size Class onto the color area and change the color palette to different shades of red.

Now lets use the size channel to visualize the amount of Total Acres Burend. Drag it onto Size. As last step let us increase the overall size of the dots by clicking on size and increasing ist.

Create now your own graphs around US Forest Fire!

Page 22: Tableau Tutorial - univie.ac.atvda.univie.ac.at/Teaching/Vis/15s/LectureNotes/Tableau_Tutorial.pdf · Tableau Tutorial Motivation Why Tableau? Because it provides smart ways for data

VU Visualization Kralj Christoph

- 22 -

Usefull Links: http://kb.tableausoftware.com https://www.broadbandmetrics.com/display/Public/2013/09/16/How+to+Create+a+Small+Multiple+Masterpiece+in+Tableau http://www.theinformationlab.co.uk/2011/09/23/blue-things-and-green-things/ http://www.theinformationlab.co.uk/2013/01/28/5-things-i-wish-i-knew-about-tableauwhen-i-started/ http://vizwiz.blogspot.co.at/2012/05/creating-interactive-monthly-calendar.html http://www.tableau.com/public/gallery