Happy first two weeks of the Data School! For today’s blog, I’m going to go over a prominent part of my application: a waffle chart with squirrels.
All of DSNY2’s applications are here: https://www.thedataschool.co.uk/ann-jackson/what-did-it-take-to-get-into-dsny2
Similar to a pie chart, a waffle chart is another way to visualize percentages that add up to 100% on a 10 x 10 square grid - it’ll look like a waffle.
The following links are: the Excel file needed for the waffle, another file for the percentages for each primary fur color of the squirrels (adapted from the original dataset), the original dataset, and the icon used.
- Waffle
- Primary Fur Color (created by rounding the percentages of each primary fur color; blank cells are “unknown” color)
- Original Squirrels Dataset
- Icon used - please include attrition!
First, we want to make the grid. Connect to the Waffle and Primary Fur Color files.
- On a new worksheet, drag Column and Row above the divider line so that they are dimensions.
2. Drag Column to the Columns shelf and Row to the Rows shelf. Sort both to be descending.
To get an idea of what the percentages look like on this grid, first change the Percentage measure default number format to a percentage with no decimal places by right clicking on Percentage. Drag Percentage to Text on the Marks card.
3. Next, we want the colors and we will need a calculated field, named Waffle Colors in my workbook.
If the percentage on the grid is equal or less than the ratio of gray squirrels, we want those squirrels to be gray.
For cinnamon squirrels, we compare Percentage to the sum of the ratios of gray and cinnamon squirrels. The ratio of gray squirrels will fall under the first condition, so the next condition will only apply to the ratio of cinnamon squirrels, and so on for the rest of the colors.
IF AVG([Sheet1 (Waffle)].[Percentage]) <= AVG([Gray])
THEN "Gray"
ELSEIF AVG([Sheet1 (Waffle)].[Percentage])
<= AVG([Gray]) + AVG([Cinnamon])
THEN "Cinnamon"
ELSEIF AVG([Sheet1 (Waffle)].[Percentage])
<= AVG([Gray]) + AVG([Cinnamon]) + AVG([Black])
THEN "Black"
ELSE "Unknown"
END
4. Drag the calculated field Waffle Colors to Colors on the Marks card.
We haven’t yet added our squirrel shape to Tableau! Download the image you’d like to use, and move it to your Shapes folder. It’s typically found in your Documents folder > My Tableau Repository > Shapes (and I recommend creating a folder within the Shapes folder).
Now you can go back to Tableau and change the Mark type to Shape. With the newly revealed Shapes, select More Shapes, and select the folder just created in the drop-down menu. At this point, you can remove the text from the grid to show only the shape.
5. Pick some more appropriate colors for the squirrels and use the Size in the Marks card to change the size of the squirrels. You’re done!
Here’s what it looks like after hiding some headers and other formatting: