How To: Create Eclipse Path Map in Tableau


I recently saw a visualization on Reddit that showed Google search result interest for the word "eclipse" plotted with the path of the 2017 eclipse.  Since I will be right in the heart of the eclipse's path, this event has been very fascinating to me, and I wanted to see if I could build the same visualization in Tableau.

Building the visualization in Tableau is very simple with most of the work occurring in QGIS.  Here's everything you will need to get started:

1. Download and install the appropriate version of QGIS
2. Download and install the MMQGIS plugin
3. Download the shapefile for the United States.  I used the file from Data.gov.
4. Download the eclipse shapefile from the Cannon of Solar Eclipses Database

Now that you have QGIS setup and the necessary files, we can start to create the shapefile for Tableau.  I'm not an expert in QGIS, so there could be easier ways to do this, but I wanted to give a big thanks to Adam Crahen for helping me through a few issues.

1. Click Layer, Add Layer, Add Vector Layer in QGIS


2. Choose the Eclipse shape file


3. Do the same again, but this time choose the state shape file


4. Now you will see both shape files overlaid.


5. Click the MMQGIS plugin and choose Merge Layers.  This will create a merged shapefile.


6.  Choose the layers to merge and select an output file


7. Open Tableau, connect to a new data source, and choose Spatial file


8. Tableau makes this really easy.  Simple double click the Geometry measure.


9. Tableau will generate the latitude and longitude and render your states with eclipse path


Now you can join or blend additional data sets to the state field.  In this case, I used the Google Trends results for the word "eclipse" and blended the data.

Feel free to download the workbook if there are any issues and comment with any questions.

Makeover Monday: Results Voided



For this week's Makeover Monday, I wanted to do something a bit more analytical.  I wanted to see if you could statistically detect when a cyclist may be using performance enhancing drugs.  Using Z score calculations in Tableau, I was able to see which years out of the last 20 were potential outliers. A good test for an outlier is +-2 Standard Deviations.  Once I built the Z score calculations and applied it, you can see that in 2005 there was a fairly strong outlier.  This is the only occurrence in 20 years where the average speed was 2 standard deviations faster than the mean and also the fastest speed in Le Tour de France history.  This record was set by Lance Armstrong, who later confessed to using performance-enhancing drugs in 2013.

Makeover Monday: Most Visited National Parks by State 2006-2016




For Makeover Monday, I wanted to visualize the bump chart in fivethirtyeight's article in a way where you could see more of the data at once.  For more information on this technique, see my post on small multiple area maps.

How To: Dynamic Clusters in Tableau




Tableau 10 brought the new clustering feature, and this is one of my favorite new features of Tableau.  One thing that you might not realize is that you can reuse the clustering model within your dashboard after you create it.  Tableau allows you to save a cluster as a group.

Tableau 10 also allows groups to be used in calculated fields, so that means we can create a parameter to switch groups and apply color.  Using this technique, we can give our users the ability to change how many clusters are being applied to the data.  This lets them explore the data on their own without depending on someone to manually change the cluster size.  In this example, we are looking at NFL Combine statistics for Wide Receivers.

First, let's create a scatterplot and see how it's done.

1.  Click the analytics tab and drag the Cluster into your view



2.  In this case, I wanted to let the user switch between 3-5 clusters.  You can create as many clusters as you'd like, but we will set the first to cluster to 3.  In this example, we are clustering by 40 yard dash time and weight.  This will allow us to see players who are big and fast, small and fast, big and slow, etc.



3.  Once you have created the cluster, drag it back to the dimensions to create a group.



4.  Name the newly-created group so you can identify how many clusters were used.



5.  Now, click Edit clusters and change the number of clusters to 4.  Do this for as many clusters as you'd like to create.





6.  Once again, drag the newly created cluster to the dimensions and name it appropriately.



7.  Create a parameter with the list of clusters and the value



8.  Create a calculated field to check the parameter value and switch clusters appropriately.



9.  Drag the new calculated field to the color mark.



10.  Finally, we can enhanced the graph a bit by adding some dashboard actions to highlight the cluster and show the player names on hover.  For more details on this technique, see this post.



Feel free to download the workbook and comment with questions.