Monday, April 7, 2014

Day 7: No More ABCs

One of the things that I really enjoy about Tableau is the community of awesome people who use this software.  There's an amazing amount of people blogging and tweeting about all sorts of things that help to push the limits of what's possible.  While surfing the Twitterverse last week, I came across this question from Tableau stud/Zen Master Matt Francis:


































So today we'll answer a question that most people ask within the first few hours of using Tableau, and even the most seasoned Tableau Zen Masters are still looking for a solution for.  Today we'll solve the great mystery of how to get rid of the "ABC". 


Superstore  data set has been working for us and I don't want to stop a good thing - 'If it ain't broke, don't fix it' right?  We'll start by making a crosstab of headers.  I'm going with Region, Department, and Category on the rows shelf.  It should look like this:






























Here comes the hack.  There's a number of steps to this one (so it's not always worth the trouble - use your discretion).  Here we go.  

You're going to have to create two calculated fields so let's go ahead and make those.  The first one you'll make is what I like to call "Blank" and it's calculation is: FLOAT("")














This one can be used over and over again, on every sheet you want to use this trick.

The other calculated field we're going to make is going to have the same name as the right-most dimension on the rows PLUS a space (because you can't create a calculated field with the same name as one that already exists in Tableau).  In our case the name of the this calculated field is going to be "Category ".  It's formula is going to be the same as the first one: FLOAT("")















There's a chance Tableau put one of those fields in Dimensions - if so, drag it down to measures.  Now we're going to add Measure Names to the Filter and select the two calculated field we just created:
































Next take "Measure Names" to the columns self and add Measure Values to the text shelf.  Things should look like this:




























We're almost there.  Take the original dimension "Category" and put it on the text shelf.  Now right click the header that says "Blank" and select Hide.  Lastly, on the rows shelf, right click the "Category" dimension and uncheck "Show Header".  You should now see this:




























Finish it off by clicking on the text shelf and making it left justified (it is test you know :)).

And Voilà (feeling French today).  


























Should it be this hard? Nope.  Are there other ways to do it? I'm sure there are.  But this is my favorite.  And now we've solved one of life's great mysteries - How to get rid of the ABCs.


Thanks for following along!

Nelson

3 comments:

  1. Don't need to select both Blank and Category, just drag Measure Name to the Filter box first and select Blank before dragging Measure Name pill to Text.

    ReplyDelete
  2. The comment above is correct. Better create blank calculated field with FLOAT(""). Drag it to the Text mark. Then hide header. Minimize the width and remove border in Format section.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete