Visualising UK Politics with Tableau

Click to view the viz on Tableau Public
This viz is inspired by a project of works from Women Empowerment (WE) viz (#WEVIZ) and the lead up and results of the 2015 UK Elections. This year 1 in 3 MPs elected were women; a record breaking 167 women were elected. I started to wonder why and how women's representation in politics was growing.

I found out about WEVIZ from the Tableau Wannabe Podcast (I'm a big fan of it and you should check it out). A conversation came up in one episode about #WEViz which the hosts participated in (more on Emily's blog). This project gathered data analysts (male or female) and asked them to analyse, in their own way, a collection of data sets on the topic of women's empowerment, representation and equality. I missed the deadline for this, but still felt it was a great way to promote doing data analysis for good causes. All the data sets are still available for you to download and do your own analysis with. I decided to be a little different and come up with my own dataset, but still on the same topic.

The Data Collection

The data for this viz is not easily available on one website or in one data source. A lot of time was spent researching on the web to gather the information from multiple sources. I web-scraped some data from government websites using, wrangled poorly formatted Excel spreadsheets with Alteryx and in some cases reverted to good old fashioned data entry by hand.

I found a great data set from the British Election Study - for each general election in 2010 and 2015 they had data for each seat on who ran and who won. However the format was not how I wanted it for analysis in Tableau.

Here's how I used Alteryx to get my data in shape:

The data originally had one row per seat with multiple columns for each candidate, and then more columns about the candidate, including their gender.
data 1
What I wanted as to have multiple rows per seat, one for each candidate.
data 2
I pulled the data in to Alteryx. One of the files was an SPSS file, but Alteryx handled that no problem. I then proceeded to pivot/transform the data three times:

  • one to create multiple rows per seat for each candidate name
  • one to create rows per seat per each candidate's gender
  • one to create rows per seat per whether the candidate had won or not

I then joined all three transformations with the multiple join tool, based on the Record Position. I then used the formula tool to parse some text so it was nicely formatted for visualising in Tableau.
alteryx module

Putting together the Viz

The Timeline was inspired by Ben Jones of Data Remixed and his excellent Presidential Gantt Chart. This visualisation was perfect for representing female Cabinet Members over time. It clearly showed how in 1997, when Labour introduced women only short-lists, more women became Cabinet Members than ever before. This is also a trend that seems to be continuing.

I also wanted to include a short bio of the cabinet members. The viz was screaming out for an embedded Wiki page, controlled by URL dashboard actions. I'm not going to re-write some of the already excellent blogs on embedding web pages in your dashboards and URL actions, instead here's a few links to my favourites below.

To help out end users who may not be used to using Tableau dashboards, I also added an info icon info with how to information in the tooltip. This is how you can create your own.
And lastly I added some navigation as well navigation. I know the tabs are shown at the top of the viz, but I find not all users spot them, so I like to have both available. Here's how to add navigation to your dashboards.

World Context
What better way to see how the UK ranks for representing women in politics than comparing it to other countries? This data set came from the Inter Parliamentary Union. I used to download this data, although it did also need some manual tidying up.
I decided a simple bar chart would best showcase this data. I highlighted the UK in red by using a logical calculation. I also added a parameter to allow the user to choose how they wished to sort the view - by number or percentage of women in the lower house.

Why 2015 Mattered
With the last viz I really wanted to hit home the message I was trying to convey: that the 2015 election was a big step forward for women in politics. Not only did the most women ever get elected, but more women than ever stood as candidates. What really stands out are the impact of Labour's women only short lists and the Conservatives A-lists, where over half of the people on the lists were women. Perhaps for my next viz I'll investigate these two factors in more detail (if I can get the data).
To highlight this story I added notations to the marks of number of candidates at the points when the Labour and Conservative parties introduced their new short lists. I also made sure to include in the tooltip data that is not available in the chart - the difference in number of candidates /MPs from previous.

Why I didn't use story points:

Before showcasing this viz I circulated it amongst my colleagues at The Information Lab. I had one comment that I really had to think long and hard about - why am I not using story points?
I have a few reasons. Firstly I do like story points, but I find it really hard to be succinct enough in my point titles. I find that they're just not big enough to include all the text I want to. Secondly the text isn't dynamic, it's a static caption. In my view titles I can insert fields from my data, making them dynamic. I really wish this was a feature in story points. Then I could say "in MAX(Year) there were X number of women elected" and it would update when my data did.
Secondly I just don't think the editing of story points is as versatile and they take up a lot of space at the top of your viz. I just couldn't fit in all the information I wanted with the story points as well.
I'd welcome any comments on this viz either on this blog, or on Tableau Public.



Post a comment

to top