2 Replies Latest reply on Feb 24, 2014 11:54 AM by Tracy Rodgers

# Display multiple pie charts for one row from different variables

If each row is a school with pie charts (percent proficient) for males and females, how do I also, per row (school) show pie charts for other variables such as Free/Reduced Lunch rates without having them interact? Currently, if I include both gender and FRL rates, it shows combinations, such as Female and FRL=Yes. I want just to show pie charts (4 in all) for Male, Female, FRL=Yes, and FRL=No in the same row (school) with no interaction.

• ###### 1. Re: Display multiple pie charts for one row from different variables

What you need to do is set up different (continuous) measures for each set of pie charts you want to have (M, F, FRL=Y, FRL=N). The way you describe what's happening is that gender and FRL are set up as discrete dimensions. Tableau draws discrete variables as headers (blue pills) that create panes for all the combinations of headers, and continuous variables as axes (green pills).

Tom Brown has a nice writeup on this here:

http://theinformationlab.co.uk/blog/2011/9/23/blue-things-and-green-things.html

To create the measures from the dimensions, you can create a set of calculated fields that does something like this:

M calculated field: IF [Gender] = "M" THEN [Rate] END

F calculated field: IF [Gender] = "F" THEN [Rate] END

etc.

To have the columns all line up, you have two options: Use Measure Names/Values, or roll your own. The advantage to Measure Names/Values is that it's really fast and easy. The disadvantage is that you only get one set of Label, Color, Angle, and Size shelves, so formatting is much more limited than the roll your own option where each column can have its own settings.

I've included both in the attached workbook. More detailed instructions for how to do the dual-axis trick to get the columns aligned and headers set up are at http://community.tableau.com/message/171852#171852.

Finally, in terms of recommended practice, for something like this where you have essentially four data points (percent proficient for M, F, FRL=Y, FRL=N) per row (school), a view with four columns of bar charts would be more legible than pie charts. In addition, sorting among the different columns will highlight differences in proficiency among the schools much more easily than pie charts. I added a bar chart view in the workbook to show this option as well, using the Sample Coffee Chain data.

Jonathan

• ###### 2. Re: Display multiple pie charts for one row from different variables

Hi Jonathan,

Just checking to see if you get this!

-Tracy