Discover more from Weird Tableau
Weird Tableau: 2
Using Tableau to advance a cause (AKA makin' shit happen with a Tableau dashboard!)
Hi, thanks for reading! This newsletter is all about using Tableau in unique ways (ie. not what you typically find in YouTube tutorials, blog posts, and community forums, etc…). it’s called Weird Tableau because I couldn’t think of anything better. I hope you find it interesting, entertaining, and all that other good stuff. And if you do, please share and subscribe!
This edition is about using Tableau to help the Connecticut Conference of Municipalities (CCM) advocate for COVID relief & investment in cities, towns, and villages to help stabilize economies. I know what you’re thinking - A COVID dashboard is not a “weird” Tableau use case. And, you’re right! In fact, I’d bet there are a substantial number of people out there whose first introduction to Tableau was a COVID dashboard. This dashboard, however, does have a “weird” wrinkle, in that it uses url actions to prompt the user to tweet at their elected officials. Here’s what it looks like and keep reading to learn how it works.
CCM was interested in having their own COVID dashboard but they wanted something that would stand out. Importantly, they wanted the dashboard to help support their efforts to secure COVID relief for local governments. In fact, CCM’s advocacy was part of a national campaign spearheaded by the National League of Cities (NLC).
With all the other COVID dashboards out there, it was important to make something unique. Encouraging the viewer to support CCM’s efforts with a tangible action was the goal. We figured the best way to do that with a dashboard was to 1) personalize the message 2) be precise about the action we wanted the viewer to take and 3) make it as easy possible for them to take that action. So, we set out to make a very granular COVID dashboard that made it super easy for viewers to tweet a message of support for the COVID relief campaign at their elected representatives.
How we did it
Step 1: Before building the dashboard, we needed to get the data. And well, its really important that your approach to building to a data visualization/dashboard reflects how it will be used. For instance, if I’m creating a dashboard about something that isn’t going to change (or at least change very infrequently), let’s say kickass 80’s hairstyles, I can just download the data in excel or a csv and work from there (note - please use the comment section at the end of this post to point me to any 80’s hairstyle data out there).
However, if your building a dashboard about something that’s always changing, you really need a direct connection to the source. In this case, the State of Connecticut’s Open Data Portal allowed access to their COVID data through JSON and O Data. Fantastic! Connecting to data through a JSON API endpoint and O Data are easy to do with Tableau.
Step 2: With the data ready to go, it was time to visualize the case and death counts. The data was updated daily and there wasn’t any reason to make something fancy, so I built a dual axis line chart with a running total and added a quick filter to enable selection by town. Dual axis line charts come in handy quite often. Fortunately, there are lots of great resources out there to learn how to make them (Hey, what do you know, Maggy (Martina) Muellner and Ethan Lang of Playfair Data just posted about this today!). I wanted to make sure the case totals were a focal point of the dashboard. Whenever I have a metric/s that warrant special attention, I like to put them inside a big circle with a contrasting color. They’re tough to miss that way.
Step 3: Ok, let’s get to the fun part! Encouraging the viewer to tweet at the their elected representatives. There were a few things to consider when building this out. First, we wanted the tweets to be uniform so the elected officials would receive the same message of support from all over the state. We also wanted people to tweet at their representatives, not the officials in other areas.
To address the first consideration, I used clicktotweet.com, which creates a unique link for a specific message that you enter into the site. So, I created a unique url for a tweet with the language CCM wanted people to send their representatives. Anytime that link is clicked, it opens the users twitter account and populates a tweet with the message. This is where Tableau’s URL actions come into play. URL actions allow the user to open a url link by interacting with your dashboard. In this case, I wanted the dashboard to open the link I created with clicktotweet.com when someone clicked on a twitter icon.
A cool thing about url actions is that they don’t need to reference a specific url. The url can be from a calculated field, or a base url and a calculated field. You can even include url parameters in the action. For instance, if you want an action to open an email with the subject line populated.
Alright, the second consideration to address was to help users people tweet at their representatives. CCM was seeking federal support so we’re talking about members of congress and senators. The senators were easy, since they both represent everyone in the state. For the congress people, I created a look up table in excel between the town names and the congress people (fortunately, there aren’t any cities or towns in CT with different congress people representing different parts of a town). I added the table to Tableau and joined on the town name.
Next, I needed to create a sheet for the Twitter icons. Easy to do with custom shapes. If you haven’t used custom shapes before, check out this tutorial from The Information Lab and this post from Interworks). When the icons were finished, I had to set it up so the appropriate congress person’s name and the associated clicktotweet.com link were activated when someone filtered to their town’s data and clicked an icon. I created a calculated field called “Tweet your congress person” based on the “Representative” field in the town to congress person look up table and used it in the url action.
Lastly, I applied the “Select your city or town” quick filter to the Twitter icon sheet and tadah! There you have it. Let me know what think in the comments and if you enjoyed the post please share and subscribe! You can test out the dashboard here.
Thanks for reading! Please share and subscribe to Weird Tableau below. And I couldn’t do a post about url actions without demoing my favorite use case.
That’s right, there is no better way to Rick Roll the decision makers than with a url action in Tableau!
Thanks for reading Weird Tableau! Subscribe for free to receive new posts and support my work.