October 24, 2022
#MakeoverMonday Week 43 - How have Major League Baseball Pitch Types Changed?
This week's data set was pretty simple. We had 21 baseball seasons and a column for each pitch type. Pivoting the metrics made it much easier to work with for me as I could then split the view by pitch type.
During #WatchMeViz (below), I create a trellis view, showed how to create groups, sets, set actions, sparklines, LODs, custom number formatting, creating a mobile view, and more.
Thank you for tuning in. Here's the video and below is my visualization.
August 11, 2022
10 Methods for Displaying Variance with Bar Charts
Using variance as a measure in bar charts helps you:
- Add context - You can answer the question “compared to what?”
- Make decisions - You can answer the question "what should we do next?"
- Alert you to areas that need focus
In this video, I show you 10 ways to add variance to bar charts. Get the workbook here.
November 16, 2020
Visualizing a Profit & Loss Statement with KPI Cards
Data HAS to be consumed quickly to be understood and to make quick decisions. A "typical" profit and loss statement is on a spreadsheet. However, spreadsheets are notorious for (1) errors and (2) being very difficult to spot areas of concern.
That's where dashboards come into play. Back in July 2017 I proposed a new way to visualize a Profit & Loss Statement (P&L). The dashboard has been very well received and put into practice at many organizations. They've reported back to me how useful it has been.
But then I got thinking about an even easier way to visualize the data. I felt like the previous version was a bit chart heavy. So, while I've been creating templates for other areas of a business (HR, Social Media, Customer Service), I decided to also focus on a new version of a P&L statement with KPIs. This dashboard is based on a Finance Dashboard example from Excel Dashboard School.
You can download the data I used to build this template here. Click on the image below to interact with and download the workbook.
October 7, 2018
Makeover Monday: Five-year Cancer Survival Rates in America
Here's the original viz:
What works well?
- Simple title that explains what the viz is about
- Cancer types are sorted from highest to lowest based on the five-year survival rate
- "All cancers" is sorted at the top since it's the overall statistic
- Using arrows to indicate improving or declining
- Using different colored dots for each time period
- Including an explanation for how the data came about
What could be improved?
- The subtitle is long. I had to read it a couple times to understand it.
- The viz overall feels kind of busy.
- By using directional arrows, the change over time is lost. The change isn't linear, but the design could be interpreted that way.
- Color the arrows by increasing or decreasing. Uterus and Cervix Uteri cancer survival rates have decreased, but that could easily be missed.
What I did
- Incorporatde the change over time
- Used BANs for the first period and the last period measured and the difference
- Used a big dot to indicate a reduction in survival rate
- Used row banding to guide the eye from left to right (taking a lesson from last week's Workout Wednesday)
- Provided an option to filter by race and gender
- Used a set to split the view into the top 9 on the left and the rest on the right; my first version was one long viz, but I didn't like how I had to scroll.
- Used reference bands vertically and horizontally to give the labels space on the ends of the lines
February 22, 2017
Tableau Tip Tuesday: How to Add Min/Max Indicators to Sparklines
First, let's have a quick look at Ann's viz:
Notice the sparklines with the indicators on the right. In this week's tip, I'll walk you through how I would go about creating those. The video is under five minutes and easily replicable. Enjoy!
February 15, 2017
Workout Wednesday: Dynamic Trellis Chart
In this example, I'm using the same Superstore Sales I've used in previous Workout Wednesdays. Here are the guidelines:
- Match my colors.
- The user should be able to choose the level of detail they want for the date.
- The date axis format should not change, irrespective of the date level chosen.
- The user should be able to pick from the list of dimensions shown.
- The dimensions should be sorted from upper left to lower right based on the sales in the most recent time period.
- Match my tooltips. Note that they change based on the options the user selects. Pay attention to the date formats in particular.
- The title should update dynamically based on the date level and dimension selected.
- The end of each line should be labeled to the right of the last point.
- There should be a little circle on the end of each line.
- Each section of the trellis should include a label for the value of the dimension for that section. E.g., California should be on the upper left when you selected quarters by state.
- The dimension labels should be centered in each section.
- There should be no gridlines, but the zero line should be included.
- Each row should should have a light divider between them.
- My final view is 900x700.
February 14, 2017
February 6, 2017
Makeover Monday: Are We Nearing the Death of Chicago Taxis?
What works well?
- Using a line chart to portray a time series rarely is a bad choice
- Nice simple labeling of the axes
- Title tells me what I'm looking at
- Red line on the grey background works well
- The y-axis is truncated, but the chart maintains a nice 3x2 ratio so that the line trends aren't too distorted.
- Scale of the y-axis is a bit odd; I like nice rounded numbers that make the math easy to do in my head
- There is SO much more data to work with; why limit to only trips?
- Could use a more impactful title
- Could use more context
Overall, another fun week. Tonight I get to introduce this to a bunch of new Tableau users at the #MakeoverMonday Live session at Tableau HQ in London. Can't wait to see what they come up with!
April 28, 2016
Guy Fawkes & Fires: Learning about the UK with Tableau
Today I attended an expo at the Devon & Somerset Fire Services with Tom Brown and Robin Kennedy. In preparation for the event I built a few dashboards for us to showcase. A friend of ours over at Surrey County Council pointed me to a dataset about fire incidents in the Greater Manchester area for 2012/13. The beauty of this dataset was that it included the locations of the fires and lots and lots of details about the fires.
Tom asked me to build something, so I started exploring by building lots and lots of visualisations to see if a story stuck out. And one did! When I created a heatmap of fires by month and day, November 4th and 5th jumped right out. That seemed a bit strange to me. I think of those dates as near elections, but here in the UK it the celebration of Guy Fawkes Day and there are lots and lots of fireworks. And, duh, fireworks = fires.
I also noticed some outliers at the beginning of March, which I still haven’t been able to explain, April Fools Day had a lot of false alarms (shocker!), and August 5th and October 27th were near bank holidays, which probably means fires from BBQs.
Yet another fun couple of hours exploring data with Tableau. It was a lot of fun showing these off to potential customers today and also seeing a bit more about the sales side of the company. Great learning indeed!
April 19, 2016
Tableau Tip Tuesday: Using LOD Calcs to Filter the Latest Month and View Sales for the Latest Day
I’ve written before about making the ends of sparklines actionable here and here and created a video here. Each of these uses table calcs to add the dot on the end of the lines. The problem, though, is the method falls apart when the end date on all of the lines isn’t the same. Yes, there are other workarounds with table calcs, but they are overly complicated.
I’ve been wanted to look at this again with level of detail expressions, thinking there had to be a simpler way to create and maintain them, and a way to overcome the drawback listed above. The video below walks through two level of detail expression:
- Create a filter using a LOD calc to dynamically return just the latest month in the data set
- Return the value of the end of EACH line of a series of sparklines
This technique could easily be parameterized, but for this example, I stick to a single dimension. Enjoy!
March 29, 2016
Tableau Tip Tuesday: How to Calculate the Number of Profitable Days per Month
This week I begin what will hopefully be a series of videos and tips about Level of Detail (LOD) expressions in Tableau. The more I teach them, the more I learn about them. Many of the example I’ll show will come from the Tableau Community and/or adjusted to expand on the exercise. Essentially, I hope to turn this into a set of use cases for LOD expressions.
This week I show you how to calculate the number of days each month that were profitable. This started with read this post on the Tableau blog. I’ve extended their example to include sparklines, an area chart and using a parameter. Enjoy!
September 1, 2015
Tableau Tip Tuesday: How to Show KPIs & Sparklines in the Same Graph
Back in November, I wrote step-by-step instructions for combining KPIs and sparklines into the same worksheet. With Tableau 9, things have changed a bit in that these are now even easier to create with LOD calcs. In this video tip, I show you how to create these views. Use these and you'll never think about Tableau's lack of synchronous scrolling again.
July 21, 2015
Tableau Tip Tuesday: Create Actionable Sparklines
So this week, I wanted to introduce you to a simple way to create sparkline indicators. Basically all I'm doing is adding a dot onto the end of the sparkline and color-coding it for a call to action.
For more information, here's a blog post I wrote in 2013 for how to create these as well, but I think the video below is simpler.
November 9, 2014
Tableau Tip: KPIs and Sparklines in the Same Worksheet
Anyway, as I was on the plane, I thought it would be great to kick off the week with a new tip. Today, I'm writing about combining KPIs and sparklines in a single view. It's very common for business users to want to see KPIs and trends in the same view. These give them a sense for the overall direction of their product and also highlight the most meaningful numbers to them. I often see people create these as separate worksheets in Tableau, but with this post, I'm going to show you how to combine them into a single view.
Combining them into a single view provides a couple of benefits:
- Tableau only needs to render a single sheet, so until parallel processing comes out in v9, you'll see a performance benefit.
- If you have a hierarchy, then expanding the hierarchy will keep the table and the sparklines together.
- Trading volume for the last 7 days
- Trading volume for the prior 7 days
- Week over week change (raw & %)
August 29, 2014
Two-way Sorting in Tableau - Sorting Some of the Viz by a Measure and the Rest Alphabetically
- Given a list of airports, there are a subset that are "targets". Let's assume they are the top 15 with the most flights in 2014: ATL, DFW, ORD, LAX, DEN, IAH, SFO, PHX, LAS, MCO, CLT, EWR, BOS, SLC, LGA
- The airports need to be sorted by the latest delay rate. However, only those in my top 15 list should be sorted by delay rate, the rest should be sorted alphabetically to make them easier to lookup.
- Include sparklines for each airport for 2010 to present.
December 4, 2013
Tableau tip: Don’t waste the ends of your sparklines…make them actionable!
Sparklines are one of my favorite chart types to include in dashboards, yet I see many people using them without providing enough context. Some people like to add bandlines, some like to add sets of dots, some like to add text, all in an effort to add meaning to sparklines. These are perfectly fine, but I think there’s a better way to make sparklines actionable. Is this the best way? Maybe not, but it is an alternative worth considering.
Sparklines were first introduced by Edward Tufte in his book Beautiful Evidence. Tufte says: “A sparkline is a small intense, simple, word-sized graphic with typographic resolution.” Stephen Few expands Tufte’s definition in his book Information Dashboard Design: “Their whole purpose is to provide a quick sense of historical context to enrich the meaning of the measure. This is exactly what’s required in a dashboard.”
When someone is creating a dashboard, they should provide as much information and meaning as possible to make the information actionable. I don’t see any examples from Tufte, Few or Jim Wahl that provide much meaningful context to the end of a sparkline.
Tufte provides some examples:
He might add a red dot to the end of the line along with some text to highlight the latest value.
While it’s a bit tough to see in this next example, Tufte has used red dots for the beginning and ends of the lines and blue dots to indicate the highest and lowest values.
It’s important to also note how Tufte always includes the values associated with all of the highlighted dots.
There are tons and tons of examples of how Stephen Few uses sparklines. Consider this example from his whitepaper Dashboard Design for Real-Time Situation Awareness.
Few says: “Meaningful context has been added to these metrics in the form of sparklines, which provide a quick sense of the history that has led up to the present.” This small section of a dashboard is a classic Few design. You’ll often see him use (1) sparklines, (2) a visual indicator of health (the red dots in this case), and (3) bullet charts closely together.
When I use sparklines, I like to combine all of the elements of Tufte and Few designs. Let’s look at an example.
On the left you see the sparklines, but notice that I use the dot on the end of the line as an indicator to take action. Tufte uses the dot one the end to indicate you’re at the end. Does that make it actionable? Not necessarily. Few separates the indicator into its own space and does not mark the end of the sparkline. My version saves space, increases the data-to-ink ratio, and provides a visual indicator to the reader in one chart.
The table to the right summarizes the sparkline, pulling from Tufte’s practices. In this example, I’m concerned with comparingthe last two 7-day periods. Notice how I used conditional formatting so that the dot on the end of the line is the same color as the text in the WoW and WoW% columns. I don’t use bullet graphs because I feel that the text itself is sufficient; I don’t want to add a graph for the sake of having a graph for everything.
Simple, concise, actionable…all things you want in a dashboard. Keep reading to see how I built these sparklines in Tableau.
Step 1: The date calculations I use in the example below are simple and efficient when you include a Max Date field in your data source. Creating Max Date as a calculated field directly in Tableau won’t always work since you need the Max Date at the row level. In this example, I’ve switched the Superstore Sales data source to Custom SQL and added a subquery to include the Max Date at the row level.
TIP: If you have a large dataset, Tableau will run more efficient queries if you push the custom SQL into a view in your database. Tableau wraps its own SQL around the custom SQL, which can get quite messy and inefficient. Creating a view will simply the query Tableau runs and improve performance.
Step 2: I like my sparklines to show the last 30 days, so I need to include a date filter. I include my date filter as the first step so that my data set is smaller to work with from the outset.
A Boolean calculation works well here. Notice how it leverages the Max Date field. This wouldn’t work if the Max Date was a calculated field inside of Tableau.
To get my sparklines to look how I like them, the column and row shelves will need to look like this. Let’s break the worksheet down into its pieces.
Step 3: Create a dummy header and place it on the columns shelf. Place it on the Columns shelf and hide the fields labels for the columns.
Step 4: Right-click-drag Order Date to the columns shelf and choose the first option, Order Date (Continuous). Notice how it only shows the last 30 days.
Step 5: Right-click on the Order Date pill and uncheck Show Header. This hides the date axis.
Step 6: Drag Category on the Rows shelf and hide the headers. The headers aren’t needed since they’re on the left side of the table; there’s no need to repeat them.
Step 7: Place Sales on the Rows shelf to the right of Category. This gives us the lines. Make them thinner, change the color to dark gray, and resize the chart to make them look like sparklines.
Step 8: Double-click on the Sales axis to bring up the axis options. Uncheck Include Zero and choose Independent axis ranges for each row or column. This gives us the view that best fits the space. Few talks about the scaling options for sparklines in Chapter 10 of Information Dashboard Design.
Step 9: We need a calculated field to show a dot on the end of the line. You might be tempted to simply turn on the line ends, but that won’t do the trick because you can’t color the line ends only. The calculated field should only capture sales for the last day. This is where our Max Date field comes in handy again.
Step 10: Drag the new Last Day Sales field onto the Rows shelf to the right of the Sales pill. Right-click on the Last Day Sales pill and choose Dual Axis. Right-click on the scale for Last Day Sales and choose Synchronize Axis. Right-click on Sales pill and uncheck Show Header.
We’re almost done. All we need to do now is color the dot.
Step 11: I like my dots to be colored by the week over week change. This requires me to create several calculated fields. You could combine all of these calculated fields into a single calculation, but I like separating the parts of the calculation to make it easier to understand and so that each calculation is reusable.
Create all of these calculated fields in this order (special thanks to Joe Mako for helping me get these calculations working and showing me why they’re more efficient than what I had been doing):
- Last 7 Day Sales:
IF [Order Date] >= DATEADD('day', -6, [Max Date]) THEN [Sales]
END - Prior 7 Day Sales:
IF [Order Date] >= DATEADD('day', -13, [Max Date]) AND [Order Date] <= DATEADD('day', -7, [Max Date]) THEN [Sales]
END - Total Sales - Last 7 Days:
IIF(LAST()=0, RUNNING_SUM(SUM([Last 7 Day Sales])), null) - Total Sales - Prior 7 Days:
IIF(LAST()=0, RUNNING_SUM(SUM([Prior 7 Day Sales])), null) - WoW (week over week):
[Total Sales - Last 7 Days] - [Total Sales - Prior 7 Days] - WoW %:
[WoW]/[Total Sales - Prior 7 Days]
Step 13: Right-click on the WoW % pill, go down to Compute Using and choose Order Date.
Step 14: Double-click on the color legend and change the settings to something like these:
You might need to do a bit more formatting to get your viz just the way you want it, but in the end, you’ll want it to look something to this:
Notice that I keep the row banding. I like to include banding on both the sparkline chart and the table so that the reader’s eyes go across the dashboard.
This might seem like a lot of steps, but once you do it a couple of times, it’s pretty quick; you’ll be able to do this in only a couple of minutes.
Building the table is super simple now that you have all of the calculations (this is why I create all of them individually). Download the workbook here to see how all of this was built.
November 25, 2010
STDs in the USA: Who should you avoid and where?
The CDC publishes an annual report on Health in the United States and included in the report is a “Chartbook”. It’s 574 pages long, but you can skip to page 32 for the start of the charts. There are some quite horrendous charts, especially the pie charts, that you will get a kick out of.
You can download the data on CDC Wonder. Once you create your query, you get a spreadsheet of the results, a map, and a bar chart. The bar chart is particularly poor and only allows you to pick two dimensions.
I have downloaded the data and produced an interactive dashboard via Tableau Public. Within this dashboard you can filter by Gender, Age, State and Disease. In the end, I have included all of the views from CDC Wonder, plus much more.
Some observations:
- The infection rate for the total US has continued to climb for all diseases combined. This is largely due to Chlamydia.
- Syphilis infection rates declined from 1996-2001, but have continued to climb since. Particularly concerning is the rate in Washington, DC.
- In fact, Washington, DC has the highest infection rate for all three diseases.
- Alaska’s overall infection rate in twice the national average, with the Chlamydia rate 86% higher than the national average. This is definitely worth looking into.
- The overall infection rate for females is more than double that for males.
- Females between the ages of 15-24 are most likely to get infection, while males are most likely between the ages of 20-24.
There are many more observations and insights to be gleaned from this dashboard. It is considerably quicker to identify outliers and trends with a simple dashboard like this than with CDC Wonder. Imagine how much more useful the “Chartbook” would be if the CDC used Tableau.
What other observations can you make?


