14
Tableau Advanced Training Student Guide www.DataRevelations.com 914.945.0567 April 2017 – 10.x For Evaluation Only

Tableau Advanced Trainingdatarevelations.com/DR_TOC_ADV.pdf · Tableau Advanced Training Student Guide 914.945.0567 April 2017 – 10.x For Evaluation Only

Embed Size (px)

Citation preview

Tableau

Advanced Training Student Guide

www.DataRevelations.com

914.945.0567

April 2017 – 10.x

For Eva

luatio

n Only

Contents ● i

Contents A. Warm Up 1

Bar Chart Colored by Profit 1 Salary Curve 2 2015 v s. 2014 Sales 3

VII. Programmatic and Combined Sets 5

Overview 5 To Create the Top 50 by Sales and Bottom 50 by Profit Sets 5 To Create a Combined Set Showing the Intersection of the Two Existing Sets 7 To Create a Scatterplot that Shows the Problem Products 8

VIII. Joins and Blends 10

Join Overview 10 To Connect To Two Tables Using a Join 11 To Create a Chart that Shows Location and Magnitude of Sales on a Map 13

Coloring the Dots – What Happens when We Try to Color the Dots by Expectation? 13 To Color the Dots by Expectation and Change the Mark Type to a Pie 13 How to Interpret the Pie Slices 15 Bonus Exercise – Show How Expectations and Sales Wax and Wane over Time 15

Blend Overview 16 To Get Familiar with the Two Databases 17 To Create a View that Shows Combined Sales for Region / Market 18

Blending Using Scaffolding -- Showing Combined Sales by State 21 To Show Sales from Two Data Sources Broken Down By State using Scaffolding 22 To Show Combined Sales 24

IX. Advanced Table Calculations 27

Moving Average 27 To Create a Visualization that Combines Actual Sales and Moving Average 27 To Turn the Tableau Calculation into a Reusable Custom Calculation 28

Top N Within a Category 29 To View the Top 10 Customers by Region Using a Context Filter 30 To See the Top 10 Customers by Region Showing All Regions at Once Using RANK() 32 To See the Top 10 Products by Region Showing All Regions at Once Using RANK() 34

Showing Rank and Magnitude 37 To Create the Overall View 37 To Create the Break Down by Region View 39 To Create a Dashboard the Combines the Two Views 39

Deploying Guided Analytics 41 To Add a Filter so that a Second Sheet Appears Only when Something is Selected in The First

Sheet 41 Adding Color and Making Life Easier with the ATTR() Function 43

Definition of ATTR() 45 To Color The Top 20 Overall Bars by ATTR(Product Category) 45

Adding by Selectable Categories 46

For Eva

luatio

n Only

ii ● Contents

To Create a Parameter-Driven Visual Ranking Dashboard 46 Pareto Analysis 50

To Create a Basic Pareto Visualization 50 To Create a Better Pareto Visualization 52 To Create a Dual Axis Pareto Chart 55

X. Sophisticated Dashboard Design 57

Overview 57 To Get Started with the File 58 To Create a Dashboard, Specify Size, and Place Worksheets 58 To Format the Dashboard 61 To Add Filters, a Logo, and a Help “Button” 62 To Create a Filter Action 64 To Create a Highlight Action 66 To Create a URL Action 66 Bonus Exercise 68

XI. Jittering (aka “Strip plots”) 70

Overview 70 To Create a Simple Jitterplot 72 To Clean Up the Visualization and Add Reference Lines 74

Controlling Jittering 77 To Create a More Sophisticated Jitterplot 78

XII. Ratios and Key Performance Indicators (KPIs) 81

Overview 81 Developing a Profit Ratio Formula – Ratio of the Sums vs. Sum of the Ratios 81

To Create a Possible Profit Ratio Calculated Field 81 To Determine the Flaw and Create and Accurate Profit Ratio 83 To Create a Profit Ratio Text Table 85 To Create a KPI Grid 86 To Create a Combined Bar and KPI Chart 87

XIII. Level of Detail Expressions (LoD Expressions) 90

Overview 90 To Calculate the Average Order Broken Down by State 91

Using LoD Expressions to Determine How Many Customers Placed a Certain Number of

Orders 93 To Create a Histogram Showing Number of Orders Placed 93

XIV. Using Parameters to Change Charts 95

Overview 95 To Create a Parameter and the First True / False Field 96 To Create the Additional True / False Fields 97 To Create a Dashboard That Changes Chart Views 98

For Eva

luatio

n Only

Advanced Table Calculations ● 37

Showing Rank and Magnitude

The Top 10 Products by Region is certainly useful but it does take some work to see the dif-

ferent rankings across regions. It would also be even more difficult to see more than 10 or so

products as there wouldn’t be enough room on the screen without having to scroll.

In the next series of examples you will create a dashboard that shows the Top 20 Products

overall and how each product fares across four different regions.

We’ll start first by creating the Overall view and then create a view that shows the break

down by Region.

To Create the Overall View

1. Click the New Worksheet tab.

2. With Orders (Superstore Sales_DR10) as your data source, drag Product Name onto

the Rows shelf.

3. Drag Sales onto the Columns shelf.

4. Sort Product Name in descending order.

5. Drag Rank of Sales to the Filters shelf and click OK when the Filter dialog box ap-

pears.

6. Right-click Rank of Sales in the Filters shelf and change Compute Using to Prod-

uct Name.

For Eva

luatio

n Only

38 ● Advanced Table Calculations

7. In the Filters dialog box, change the range of values to go from 1 to 20, as shown be-

low.

8. Control-drag Rank of Sales from the Filters shelf and drop it on the Rows shelf.

9. Change Rank of Sales on the Rows shelf from a continuous measure to discrete by

right-clicking it and selecting Discrete.

10. Move the now discrete version of Rank of Sales to the left of Product Name, as

shown below.

11. Rename the sheet Top 20 Overall and save your work.

For Eva

luatio

n Only

Advanced Table Calculations ● 39

To Create the Break Down by Region View

1. Duplicate the Top 20 Overall worksheet.

2. Drag Region onto the Columns Shelf. You will see a lot of blank rows.

3. Drag Product Name off of the Rows shelf and place it on the Level of Detail by

dragging it on top of the Detail button on the Marks card. Your screen should look

like the one shown below.

4. Rename the worksheet Rank by and save your work.

To Create a Dashboard the Combines the Two Views

1. Click the New Dashboard tab.

2. Change the width to 900 and the height to 600.

3. Rename the tab Sales showing rank and magnitude and indicate you want to show

the title by selecting Show Title from the bottom left corner of your screen.

4. Drag Top 20 Overall onto the dashboard.

5. Drag Rank by to the right of Top 20 Overall.

6. Select Top 20 Overall and indicate that you want the worksheet to fit the Entire

View.

7. Select Rank by and indicate you want the worksheet to fit the Entire View.

8. From the Dashboard menu select Actions.

9. When the Actions dialog box appears, click Add Action and select Highlight.

You'll find this at the top of

your screen, below the

menu bar.

For Eva

luatio

n Only

Sophisticated Dashboard Design ● 57

X. Sophisticated Dashboard

Design

Overview

In this next series if exercises we’ll create a sophisticated and polished dashboard that incor-

porates the following components and functionality:

• Four different chart types

• A Quick Filter

• A Help Button

• A Logo

• Three different types of dashboard actions (Filter, Highlight, and URL)

Here’s what the completed dashboard looks like.

Here are the steps we’ll go through to create the dashboard:

1. Become familiar with the four existing charts.

2. Create a new dashboard, specify its dimensions, and place worksheets and contain-

ers.

For Eva

luatio

n Only

58 ● Sophisticated Dashboard Design

3. Format the dashboard.

4. Add a quick filter that applies to selected worksheets on the dashboard, a Help but-

ton, and a logo

5. Add Filter, Highlight, and URL Actions.

To Get Started with the File

1. From the Starter folder on your USB drive, open the file CustomerProfitabil-

ityDashboard.twbx.

2. Look at the first tab, Customer Map. Notice that Region is on the Filter shelf but

there isn’t a visible Filter. Each dot corresponds to a different customer. The color

of the dot reflects profitability and the size of the dot reflects the magnitude of sales.

3. Look at the second tab, Pareto. This is very similar to the Pareto chart you created

in the previous example.

4. Look at the third tab, Customer Info. This contains a list of every customer and

shows each customer’s total profit and the total number of orders they placed, sorted

by profitability.

5. Look at the fourth tab, called Help. Hover over the question mark to see the tool top

associated with the worksheet. You should also look to see how the dimension

“Help” is defined by editing its formula.

To Create a Dashboard, Specify Size, and Place Worksheets

1. Click the New Dashboard tab (it’s next to the New Worksheet tab).

2. Specify that the size should have a width of 900 and a height of 700. This is a safe

size that should work on just about any screen.

For Eva

luatio

n Only

Sophisticated Dashboard Design ● 59

3. Click the Show dashboard title check box.

4. Rename the tab Customer Profitability.

5. Save the packaged workbook with a new name.

6. Drag Customer Map from the list of worksheets and place it below the dashboard

title, as shown below. Notice that the two legends that were visible on the worksheet

are also displayed on the dashboard but that there is nothing to indicate there is a Re-

gion filter available.

For Eva

luatio

n Only

60 ● Sophisticated Dashboard Design

7. Drag a Horizontal container and place it above the Customer Map and below the ti-

tle, as shown here.

Note: Layout containers help you organize sheets and other objects on a dashboard.

These containers create an area in the dashboard where objects automatically adjust

their size and position based on the other objects in the container.

For Eva

luatio

n Only

70 ● Jittering (aka “Strip plots”)

XI. Jittering (aka “Strip plots”)

Overview

Consider the scatterplot below that shows the relationship between Age and Salary where we

have a mark for 2,398 people that responded to a salary survey.

Suppose we just want to see the distribution for salary independent of age. Here’s what hap-

pens when we remove SUM(AGE) from the Columns shelf.

For Eva

luatio

n Only

Jittering (aka “Strip plots”) ● 71

It’s very difficult to see how the marks cluster as there are so many overlapping marks con-

fined to a single column.

For Eva

luatio

n Only

72 ● Jittering (aka “Strip plots”)

Using Tableau’s INDEX function we can “jitter” the marks, making it much easier to see the

distribution.

To Create a Simple Jitterplot

1. Create a new workbook by clicking File and selecting New.

2. Connect to the data source Salaries_Updated.xlsx and indicate that you want

Tableau to create an extract.

3. Drag Gender on to the Columns shelf and Salary onto the Rows shelf.

4. Drag ID onto Detail.

For Eva

luatio

n Only

Using Parameters to Change Charts ● 95

XIV. Using Parameters to Change

Charts

Overview

There will likely be times when you will want to present your users (or yourself) with multi-

ple views but are constrained to only being able to see one or two views at a time because of

the size of your dashboard. In cases like these you may find it very valuable to swap charts in

and out of a dashboard using a parameter.

In the example below you can change among three different views using the View parameter,

as shown below.

Zen Master Tip: This “swapping” technique has saved my bacon on many occasions.

For Eva

luatio

n Only