Moving table headers to the bottom (Making a table look like a chart)

Posted by on Dec 3, 2012

When creating a view in Tableau, fields are placed on the rows and columns. If the field is blue (discrete), a Header is created. If the field is green (continuous), Tableau creates an axis. (For more on blue/green, see Tom’s earlier post – http://www.theinformationlab.co.uk/2011/09/23/blue-things-and-green-things/)

Headers exist on the left and top of a view, and axes exist on the left and bottom.

However, what happens if you want a header to be on the bottom, masquerading as an axis? Can this be done? Can Tableau be persuaded to abandon best practice for the sake of getting the view you (or more likely, your boss) wants?

Yes. Yes it can. And here’s how:

The first thing to mention is that, as with all workarounds, there are a specific set of conditions under which this trick will work, but we’ll come to those later. For now, let’s get creating!

I’ll be using the standard superstore sales dataset for this example, and will be working through 2 examples of this together; one text and the other, pie charts.

 

The setup

Create a view with headers on both rows and columns. I’ve used Order Priority as, whilst the values are discrete, with nothing to link one text string to the next, we know that there is an inherent order to them. Give people a check box with low, medium or high, and invariably you will get someone who tries to put it in between two choices.

How the table looks at the start

How the table of pies looks at the start

 

The Trick (In Theory)

At this point, we can not move the headers down to the bottom. There is no option to do so within Tableau. And so we move on to the pivotal point of the trick, as quoted from the Tableau manual:

Caption from the Tableau Desktop user manual

Whilst this Table Option may often be used to make all headers appear at the top, we are going to use it to push the header to the bottom. The key is that this only occurs when there is a vertical axis on the view.

The Trick (In Practice)

Step 1) First off, we need to use a suitable continuous field. We don’t want it to ultimately affect the view, which means it needs to be the same for every header. For this we can use a calculated field “One”, with a value of AVG(1)

Creating the field One

Step 2) Add this new field to the view, as a vertical axis

How the table looks after adding the One field

How the table of Pies looks after adding the One field

 

Step 3) Edit the axis to have a fixed range between 0 and 2

Fix the axis range

Step 4) Hide (Un-show) the axis Header

Hide the axis by unticking Show Header

Step 5) Enjoy your Header chart

How the table looks at the end of the trick

How the table of pies looks at the end of the trick

 

The Conditions

As I mentioned earlier, there are limitations to this trick:

  1. Only the last discrete field on the column shelf is moved to the bottom. Any other fields stay on top
  2. This does not work if there is a horizontal axis

 

The Conclusion

So there you have it. If you’ve ever wanted to make your table look like a chart, now you know how.

 

 

Andrew Ball

Tableau Consultant

Latest posts by Andrew Ball (see all)

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>