Women in US Legislature 2016 Exercise sheet 2


Facebooktwittergoogle_pluspinterestlinkedinmailFacebooktwittergoogle_pluspinterestlinkedinmail

womeninstatelegislature2016

For #MakeoverMonday on Monday 18th April 2016 I decided to build a fun and interactive Tableau dashboard based on the number of Women in US Legislature 2016. I have always looked for a reason to mimic one of the first Tableau Dashboards that impressed me, The Adoption Gap, and since I had fun so much I put together a step by step tutorial for you to following along.

Before you start I would recommend checking out the Dashboard on Tableau Public by clicking HERE

The Data Set

The data set for this dashboard is available on Andy Kriebel’s blog as a Tableau Data Extension (TDE) or an Excel document. Let us start by following the link (HERE) and downloading the Tableau Data Extension (TDE).

Once the Tableau Data Extension is downloaded double click on it to explore this data source within Tableau. Tableau Desktop should open and show you the following:

womeninlegislature1

We are going to start by building individual worksheets and then combine these worksheets on a Dashboards and add actions for interactivity.

The Circle

The first worksheet we will create is the visualisation of all US states in a circle.

We will start need to create two Calculated fields called X and Y

womeninlegislature2

womeninlegislature3

Now we will start to build the visualisation by:

  • Drag Exclude DC onto the Filter Panel (this removes the District of Columbia)
  • Drag X onto the Columns
  • Drag Y onto the Rows
  • Drag State onto Details in the Marks Panel
  • Right click on the X pill, go to Compute Using and select State
  • Right click on the Y pill, go to Compute Using and select State
  • In the Menu click on Maps, go to Edit Locations and change the Country/Region to United States
  • In the Marks Panel change the mark type to Filled Map
  • Drag the % Under Represented (the first item) on the Color Mark

What you should have is the following:

womeninlegislature4

Now that we have the base we will start formatting visualisation:

  • Right click on the visualisation and select Format
  • Go to Format Shading and select the worksheet color to be Black
  • Go to Format Borders:
    • In Row Divider, Pane, select None
    • In Column Divider, Pane, select None
  • Go to Format Lines:
    • In Grid Lines select None
    • In Zero Lines select None
  • Right click on the X pill and deselect Show Header
  • Right click on the Y pill and deselect Show Header
  • Click on the Color Mark and then Edit Color:
    • In Palette select Red
    • Deselect the Start
    • Deselect the End
    • Click Ok
  • Click on the Size Mark and increase the size to the half way mark
  • Click on the Tooltip Mark and delete everything apart from <State>
    • Also deselect Include command buttons

After following the steps you should see:

womeninlegislature5

Rename your worksheet to The Circle to complete this first workbook and remember to save your work.

Commentary

Now we will create the descriptive text for the dashboard.

  • Create a New Worksheet
  • Right Click on the canvas and select on Format
    • Select Format shading, in worksheet select Black
  • Go to Format Borders:
    • In Row Divider, Pane, select None
    • In Column Divider, Pane, select None
  • Drag the following items onto the Label Mark
    • State
    • % Under Representated
    • % of Population
    • % of State Legislature
  • Click on the Label Mark and put in the following text input the following:

womeninstatelegislature6

<State> has a population of <SUM(% of Population)> women but represented in State Legislature by <SUM(% of State Legislature)> women. This is an under representation of <SUM(% Under Represented)>

We should now get the following:

womeninstatelegislature7

Rename the worksheet to Commentary and save your work.

Bar Charts

Now we will create the bar charts for % Population

  • Create a New Worksheet
  • Drag Metric onto the Filters Panel and select % of Population
  • Drag Measure Names onto Columns
  • Drag Female and Male onto Rows
  • Right click on the Males pill and select Dual Axis
  • Right click on the Males Axis and select Synchronise Axis
  • Click on All in the Marks Panel and change the Mark Type from Automatic to Bar Chart
  • In the Marks Panel click on SUM(Female)
    • Drag Female onto the Label
    • Change the Female from Sum to Avg
  • In the Marks Panel click on SUM(Male)
    • Drag Male onto the Label
    • Change the Female from Sum to Avg

You should now see the following:

womeninlegislature8

NOTE: Do not worry about the values for now as this currently represents all states summed but we will apply Actions filters later to only show the values by State.

Now we will apply the required formatting:

  • Right click on the SUM(Female) and deselect Show Header
  • Right click on the SUM(Male) and deselect Show Header
  • Right click on the visualisation and select Format
  • Go to Format Shading and select the worksheet color to be Black
  • Go to Format Font, Header and select a lighter shade of White
  • Go to Format Borders:
    • In Row Divider, Pane, select None
    • In Column Divider, Pane, select None
  • Go to Format Lines:
    • In Grid Lines select None
    • In Zero Lines select None
    • In Axis Ticks select None

Rename this worksheet to % Population and you should now have the following:

womeninlegislature9

Now we will create the % of Legislature Bar Chart.

  • Right click on the % of Population and select duplicate.
  • Rename this worksheet to % of Legislature
  • Right click on the Metric in the Filter Panel and choose % of Legislature
  • Save your work

NOTE: Duplicating does save you a bucket of time.

Creating the Labels

We want to ensure that we have worksheet to represent the labels for the Bar Charts. This is done so that when you have no state selected the labels also disappear.

  • Create a New Worksheet
  • Create a Calculated Fields

womeninlegislature10

womeninlegislature11

  • Drag the % of Population Label into Labels Mark
  • Format the Worksheet to look like the following

womeninlegislature13

Duplicate this worksheet and replace the % of Population Label with % of Legislature Label. You should now have the following:

womeninlegislature12

Now save your work as we are finally ready to assemble the Dashboard.

The Dashboard

Now that we have created our Worksheets we are now going to assemble them onto a single Dashboard.

  • Create a New Dashboard
  • In the Menu select Dashboards, Format, select the Default Shading as Black
  • Make sure you click on Floating before you start adding Dashboards
  • Drag all the worksheets onto the Canvas
  • Make sure you select Entire View
  • Right click on all worksheets titles and click Hide titles
  • Arrange the workbooks as seen below.

womeninlegislature14

NOTE: You can use containers if you wish to make things neater.

Now we will create the actions to enable interactions with the dashboard.

  • In the Menu select Dashboard and then Actions
  • Click on Add Action and select Filter Actions
  • Give your Filter the Name of State Filter Action
    • Under Source Select The Circle
    • Under Target select all worksheets apart from The Circle
    • Under Run actions on choose Select
    • Under Clearing the selection will choose Exclude all values
    • Click Ok
  • Now click on The Circle, click on the down arrow to open the worksheet menu
    • Select Ignore actions

Save your work and try interacting with your Dashboard.

Final Touches

With that done the Dashboard is now 99% completed. What remains is to tweak the cosmetics of the Dashboard, adding Labels and more importantly publishing this onto Tableau Public or sharing with friends.

I hope that this step by step guide has been informative and that you have learned a thing or two. Please do leave me your comments below.

womeninlegislature15

Facebooktwittergoogle_pluspinterestlinkedinmailFacebooktwittergoogle_pluspinterestlinkedinmail

Toan Hoang

About Toan Hoang

Toan Hoang is a technology enthusiast with a broad understanding and appreciation of most aspects of technology but with a passion for Business Intelligence Solutions and Technologies, Data Management and Web Programming.


Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “Women in US Legislature 2016 Exercise sheet

  • Rajeev

    Dear Toan,
    This is one of the finest post of interworks.First of all thank you so Much for this wonderful step by step description. Even a naive member can understand .you are too good .keep guiding us with your skills
    Just a quick suggestion -it would be great if you can explain this step in much broader way,sometimes difficult to interpret “Now click on The Circle, click on the down arrow to open the worksheet menu
    Select Ignore actions’