css.php

Parts of a Whole (12)

Parts of a Whole

Data Visualization and Design | CUNY Graduate Center | Summer 2019

Goals

  • Decide which parts-of a whole visualization is most effective for your data
  • Explore different methods to visualize the same dataset, communicating a similar story

Data

Airbnb

Waffle Structure

Dashboard

Video

Parts of a Whole

  • Pie Chart
  • Multiple Pie Charts
  • bubble bar Charts
  • Tree maps
  • Heatmaps
  • Stacked Bar
  • Multiples Scattered
  • Waffle
  1. The key to a Waffle Chart is the auxiliary table. You need an excel spreadsheet with row number, column number, and percentages. This will provide the framework to build your visualization on. This is the "Tableau Waffle Structure" Sheet. You can use this for every Waffle Chart you ever make 🙂

We’ll start by cleaning up our AirBnB data source

  1. First we need to make a Column for every Borough with a 1 if that record belongs to that borough. We’ll start with Brooklyn Name your field ‘CALC: Bklyn’

IF [Neighbourhood] = "Brooklyn" THEN "1" END Repeat for all the other boroughs.

  1. Create another Calculated Field with the percentage that each borough represents individually.
  2. Name your fiels ‘CALC: Bklyn %’

SUM(INT([CALC: Bklyn]))/COUNT([Host Id]) Repeat for all the other boroughs

  1. Add the TableauWaffleStructure.xlsx as an additional dataset. You will NOT join these datasets.

Now we will move over to a new sheet. In the New Sheet,

  1. The AirBnb_NYC dataset should already be loaded.
  2. Select the TableauWaffleStructure.xlsx as your primary dataset.
  3. Drag Row to Rows and Column to Columns.
  4. Go to Analysis Menu (in the header) and untick ‘aggregate measures’ to show each value individually.
  5. Change the shape to square and increase the size to get a waffle.
  6. Then we create another calculated field that links these two datasets. From the Data Pane, use the drop-down menu to Create a Calculated Field (this new field will appear in the TableauWaffleStructure dataset). The purpose will be to tell our waffle how many squares to color

  7. Name your field ‘CALC: Bklyn Color’ [AirBnB_NYC (airbnb)].[CALC: Bklyn %] >= SUM([Percentage]) Repeat for all the other boroughs. (this technically isn’t necessary because of a mathematical quirk, but if you do this with other datasets, you’ll need this step)

  8. Drag this calculated field to color marks card and your waffle should appear – for Brooklyn vs. Everywhere else in NYC.
  9. You can change the shape from square to any other custom shape.
  10. Hide the headers and gridlines by editing the axes.
  11. Add percentages on the chart in annotations if required.

If you wish to make a waffle grid with more than one category, you will have to write a rather complicated statement to make a calculated field that is dependent upon all of the categories you want to include. Here we’ve made Brooklyn, Manhattan, and Other

IF [AirBnB_NYC (airbnb)].[CALC: Bklyn %] >= SUM([Percentage]) THEN "Brooklyn" ELSEIF [AirBnB_NYC (airbnb)].[CALC: Bklyn %] + [AirBnB_NYC (airbnb)].[CALC: Mnhtn %] >= SUM([Percentage]) AND [AirBnB_NYC (airbnb)].[CALC: Bklyn %] <= SUM([Percentage]) THEN "Mahattan" ELSE "Other Borough" END

To use your Waffle Chart in a story, you will have to play with the size a bit – it works better in a dashboard.

Need help with the Commons? Visit our
help page
Send us a message
Skip to toolbar