Blue vs. Green

Understanding How Tableau Thinks: Discrete vs. Continuous Data

5

This week I’m doing my very first Tableau training session. In explaining how Tableau works, or how it thinks, which is important for really leveraging the power of the program, one must understand, the difference between the blue and the green pills. This blog is also taken from my data school days and will be very much like Tom Brown’s blog post, but here goes my interpretation…

When you look at your Tableau Desktop window, you will notice that your data has been split into ‘fields’ and sit in either a ‘dimensions’, ie. what you are measuring, or ‘measures’ ie. the measurement that was made, shelf, in the data pane to the left. These fields are either blue or green and when brought into the chart building view, they are called pills (because they look like pills) and retain their blue or green colour.

The colours actually represent the type of data in the field. The blue pills contain discrete data, and the green pills contain continuous data. The blue discrete field contains a finite number of values, so in the example there are only a finite number of product categories. The green continuous fields contain an infinite number of values ie.  the number of sales could be infinite.  

A field being discrete or continuous, impacts every aspect of functionality in the analysis, from the way the data is displayed, to the behind the scenes processing of the data and understanding how this differs is essential to understanding how Tableau works. I’ll explain these differences below, using the Superstore Sales Sample data that you get with Tableau Desktop. I will use them in columns and rows to build a chart, in filters to streamline data and in colour, to add levels of detail or highlights to your presentation.

  • Columns and rows

3

  • When a discrete field is added to a column or row, it will be displayed as a ‘header’, something that is used to divide your data.
  • If you do the same with a continuous field, an axis is drawn which will give you an aggregation of the field you have selected for the entire data set. For examples, if you are looking at the Superstore Sales example data set, provided by Tableau, and you have put sum of ‘sales’ on the column or row shelf, you will be given the sum of all the sales in the entire data set ie. over x amount of years, for x amount of product types, in one column or row, respectively.
  • Now by using both, you bring in your continuous data, and can start breaking this down by the categories set by the discrete data, for example, breaking down the sum of sales, by the year or (sub)category of items sold.

Pro tip: You can sort your data really easily by pressing the little  button on the axis  you want to sort by.

Knowing this, you can make almost any variation of chart in tableau. Bringing multiple discrete fields into the view, gives you a nested division of the discrete fields. For example if you bring in category and subcategory.

8

Bringing in more than one continuous field, gives multiple axes for the same discrete fields. For example if I bring in both sales and profit for my product category, I will now essentially have to mini graphs.

4

You can make a scatter plot, by plotting two continuous fields against each other, making two axes.

9

Alternatively you can make a table, by placing your discrete fields on the columns and shelves to create headers and placing a continuous field on the details on the marks card to flesh the table out.

15

  • Filters

What happens when you put discrete fields and continuous fields on filters, again, really shows what the difference between discrete and continuous data is.

  • Placing a discrete field on filters will bring up a dialog box, which allows you to choose ‘members’ of the discrete fields.
  • When placing a continuous field on the filter shelf, you first have to give an indication of whether or not you want your data aggregated and if so, how. You are then prompted to select a range from your continuous data.
  • Colour

Once you have created a chart, you can use colour to show another layer of information.

  • A discrete field will essentially put a grouping on by colouring members of that group, or break down a bar into subcategories, depending on what granularity you colour by. In the example, of sales by subcategory, if you bring category to the colours shelf, all subcategories within one category will be given one colour.

10

  • Bringing a continuous field to the colours shelf, will give you a divergent colour scale for that particular field. For example, if you were to bring profit to the same view, you then get the sales bars coloured by a profit scale, with the least profitable in red and the most profitable in green. These colours can of course be changed!

11

Hopefully that has cleared up the distinction between the blue and the green things in Tableau!

Best Practices

Best Practices in Data Visualisation:  A Review of ‘Storytelling with Data’ and my Before and After.

One of the biggest mistakes I made when applying for my position at the data school (well at least in my opinion) was that I made my visualisations far too complicated. I fell into that trap that I think all Tableau newbies fall into. I was so impressed with all the things that I could do with Tableau, that I just wanted to cram in everything I had done into one dashboard.

The first week in the data school was all about best practices in data visualisation and one of the books that I read was ‘Storytelling with Data – a data visualization guide for business professionals’, written by Cole Nussbaumer Knaflic. Here is a review of that book:

Storytelling with Data: A book review

‘Storytelling with Data’ is a great book for anyone who is just starting their data visualization journey. The basic gist of the book, is to keep your visualisations simple and to the point, a message that has now been thoroughly homed in, via this book and every other form of data visualisation best practice advice I have received.

The book is broken down into 10 chapters, of which 5 make up what I would consider the the core of the book. These teach you how to put your data into context, guide you through choosing effective visuals, teaching you that ‘clutter is your enemy’, how to focus the attention of your reader and to ‘think like a designer’, using size, colour, positioning and most importantly, simplicity to make an effective visual. Chapter 6 walks you through how to tie a story together and the rest put the lessons learned in the first 5 chapters into play.

What I appreciated most about this book, is that it practices as it preaches. Storytelling with Data is written well, in a very easy to follow manner, thoroughly driving home the points that it wishes the reader to take home. Because the book implements all the highlighting or rather ‘leveraging preattentive attributes’ that it describes, it makes it very easy to get all of the important information, without having to take too long to read the book and also makes it easy to find the tips you have learned and want to revisit.

My second favourite things about this book is the graphic examples. Nothing brings home the point about best practices of visualisation better than a visualisation! In particular I enjoyed the before and after visualisations, which not only brought home what I could be doing better and also became a fun game towards the end, seeing how much I had learned and if I could find all the elements that needed improving! The book even gives you a treasure trove of great sources of ‘inspiration through good examples’ by data viz gurus.

In closing, this book is great data visualization noobs like me. It gave me a fresh, concise and effective way to tackle the data visualisation challenges that have and are still to come my way!

In the second week of the data school, we were asked to make a ‘reviz’ of the data we had submitted for our initial applications. I was able to apply so many of the tips I had learned from ‘Storytelling with Data’. Have a look for yourself here:

before
Link: Before

vs.

after
Link: After