Senatorial Actions

Posted by Tara Walkeron October 23, 2014

For #VizTheVote month, I found some surface level data about the 100 United States Senators – name, party, class, and website. At first, I wasn’t sure of what kind of viz to make because there were many different angles I could take. Did I want my readers to learn more about the individual senators? Or, did I find meaning in showing the relationships between senators among states, parties and classes?

I began to explore and ask questions of my data. My first question was: which states have senators from two parties and which have two senators from the same party?

I soon realized that the structure of my data wouldn't easily allow for me to see the geographic comparison of states with Republican vs. Democrat vs. Independent senators. I had two options:

  1. I could show three separate maps for each of the parties.

    This method can be extremely useful when mapping congressional districts as shown in this post by Ben Jones on his site: Dataremixed.
  2. OR I could try to find a way to combine the party information on one map.

I chose to do option 2. When beginning to tackle how I would accomplish this, I started out by playing around with Number of Records. If I placed Number of Records on Color on the Marks card, I got this:

DUH. Each state has the same number of senators (2), so the coloring will be identical for each state. I needed a way to distinguish the senators by their party and then bucket that information by state. Calculated fields to the rescue!

I created a new calculated field titled "Coloring" that will assign each senator a value according to their party.

That is, those senators with the Democratic party will be assigned a "1", those with the Republican party will be assigned a "-1" and those with the Independent party will be assigned no value. When I colored my map by this new field, each state will be colored by the sum of the values for each senator from that state:

  • 2: Two Democratic senators
  • 1: One Democratic senator, one Independent senator
  • 0: One Republican senator, one democratic senator
  • -1: One Republican senator, one Independent senator
  • -2: Two Republican senators

My first question has been answered! We can easily see the party breakdown of each state in comparison with the other states.

Dashboarding and Using URL Actions

Fast forward through the rest of my data exploration... I am now ready to present my data and start creating a dashboard. Whenever I think about creating a dashboard, I ask myself two questions:

  1. What information do I want to show?
  2. How do I want my readers to interact with the viz?

Since this dataset has a relatively low number of columns, my answer to the first question is easy: I want to show the senators both by party and by state. With that information on the dashboard, I next wanted to add in more interactivity with dashboard actions!

If dashboard actions are completely new to you, check out this amazing walk through by Peter Gilks titled A Rough Guide to Tableau Dashboard Actions.

Before I created any actions, I thought of a few ideas of how I'd want to structure my viz - sketching these out on paper can be extremely helpful! The idea that resonated with me was arranging the viz with a map at the top and my senators list at the bottom. I then added 3 dashboard actions. See if you can find all three actions in the viz before looking at the key at the bottom of this post!

An important thing to remember when using dashboard actions is that you need to guide your reader as to how to interact with these sheets. Although it may be very obvious to you on how to interact with the viz, it may be confusing to someone who isn't as familiar with the data. Pull aside one of your friends or colleagues and test the viz on them!

U.S. Senator Actions Key

  1. Filter Action: I wanted the map to filter the senator list. In my mind, this should give the reader the ability to "drill down" into the individual senators.

  2. URL Action: Suppose a reader is curious about their state's senators, or any state for that matter. By adding this URL action, I provide a mechanism for someone to explore any information/data on the senator's website (data that I do not have in my dataset).

  3. Highlight Action: Did you notice that I floated separate maps for Alaska and Hawaii? Doing this maximizes the space on the dashboard and also makes it easier to see the smaller states in the northeast. However, with this method you lose out on the consistent highlighting when a user clicks on a state. No worries! By adding this highlight action, we regain the consistency.

Adding a Poll to a Viz

Believe it or not, you can actually add a poll to a viz! This method uses dashboard actions to tie the information in a viz to a google doc. For more information about how to do this, please go here.


Tara, Tableau:

What an incisive and insightful (and so very timely and delightful) post!

Thank you,


This is helpful. But one question, theoretically, a 0 also could have been 2 independent senators (though I don't think any state has such a setup). I usually try to use numbers to rep words in Excel before importing to try to control for all contingencies but it is great to know how to do that in Tableau. Thanks

Add new comment