Blue things and Green things
Why are some things in Tableau desktop BLUE and other things GREEN?
Understanding the difference between the blue and green items in Tableau is (IMHO) the single most important piece of understanding necessary to make Tableau function well.
It it so fundamental, that I can honestly say that until I understood this, I was pretty much guessing how Tableau would react to my actions.
What am I talking about?
Take a look at the image below. Marked by the blue and green arrows, you can see a number of blue pills on various shelves (such as the row shelf and the colour shelf), and you can see a number of green pills elsewhere.
You should also able to see that the icons in the data window are either blue or green.
Doesn’t the blue/green colour indicate a measure or dimension?
No. That conclusion is easily reached as most dimensions are blue and most measures are green, but it is not correct.
The colour is used to indicate which fields are discrete and which are continuous.
Blue fields are discrete and green fields are continuous.
Note that there are many grey areas in the distinction between discrete and continuous. In the example given above – the possible PRICE of an item does not actually result in an infinite set of possible values. It is however theoretically possible for an item to be priced at any value, so we would expect this value to be considered as a continuous variable.
Why this is so important to Tableau?
Discrete and continuous fields are treated in very different ways when used to create a Tableau view. Understanding how Tableau behaves when these different field types are used is fundamental to understanding how to use Tableau.
The effect of using these different field types is most obvious when adding a field to the following shelves:
Rows and Columns – for controlling the layout of your visualisation
Filters – for restricting the data being displayed
Colour – for determining the visual presentation of data
Using Blue/Green fields on Rows/Columns
When you add a BLUE field to either the row or column shelf, Tableau responds by displaying a TABLEAU HEADER (don’t get confused with the terminology used to describe column headers in Excel for example – these are a little different – hence ‘Tableau Header’).
The ‘Tableau Header’ is highlighted below using a blue box.
In the following view, there are THREE blue fields on the row and column shelves.
This causes Tableau to respond by drawing THREE Tableau headers – one across columns, and two across rows.
When you add a GREEN field to rows or columns, Tableau responds very differently – an AXIS will be drawn. Or more correctly, one axis per row/column (or just one axis is there are no headers in the view)
In the first image – a single green field is placed on rows – this results in a single VERTICAL axis as there are no other headers in play.
In the second view – there are multiple axis created – as Tableau is creating one axis per row/column – the ‘Region’ field is creating a Tableau header which is causing 4 rows to be displayed. The result is 4 rows, each of which has it’s own axis.
In the following view, three green fields are placed on the columns shelf – this results in Tableau drawing three axis – one each for sales, profit and discount.
Armed with this information – we can now start to interpret how to draw almost any view with Tableau.
For example – a scatter plot is typically a view which has two axis, one vertical and one horizontal. Using what we know about green and blue fields, we know that a view requiring two axis must have a green pill on both rows and columns. The only thing left to decide is which fields we are interested in – Sales and Profit for example (note I have also placed another blue field on the ‘Level of Detail’ shelf)
Now lets consider a table of data – we know a data table does NOT have an AXIS – therefore we can assume that only BLUE fields should be placed on rows or columns to create a table, as shown here – NOTE that the green field is placed on the text shelf, rather than on rows or columns (as we do not want to create an axis).
Using Blue/Green fields on Filters
Placing a blue field on the filter shelf causes Tableau to respond by displaying a dialog box asking which ‘members’ of the discrete field should be included in the view. The fact that the blue field is discrete means that Tableau simply needs to know which of the available values should be included.
More information is required if a green field is placed on the filter shelf.
Placing a green field on the filter shelf results in a different type of dialog box being displayed by Tableau. Before Tableau can complete the filter, it needs to know whether you would like to filter based on an AGGREGATION of the data, or whether you would like to filter on the RAW data.
Choose ALL VALUES if you want to filter on the raw data. This causes Tableau to compare your filter settings with the value (for sales in this case) which is held in each row of your data. In this example, you could choose to filter out all sales where the dollar value was less than 5 dollars.
Choose an aggregation if you want to filter out ‘members’ of the dimension by which you aggregate the data. For example, if you choose to aggregate by ‘State’ and you are filtering on SUM(Sales) then your filter settings may exclude states which have total sales of < $500,000.
Once you have added this filter, you can display it as a QUICK FILTER (by right clicking the pill on the filter shelf) and then set the display format to a slider.
Using Blue/Green fields on Colour
When you use the colour shelf – the response from Tableau varies depending on whether you place a blue field or a green field on the shelf.
Since blue fields represent a ‘discrete’ set of values, the response from Tableau is to choose a set of colours which are themselves discrete – and apply each of these colour to a member of the field placed on the shelf.
For example, placing ‘Region’ on colour when ‘States’ are displayed results in the following shading (I have also grouped states by region by placing Region on the row shelf).
It is now possible to edit the colours chosen by Tableau either by double clicking the legend entries or by using the drop down on the colour legend (top right corner).
However you start the process of editing colours, the dialog presented only allows you to choose colours from discrete sets.
When you place a continuous variable on the colour shelf, Tableau responds by adding a sequential colour to the members of the dimensions in play. In this case, Tableau as defaulted to show a light to dark gradient of green
This can be edited by double clicking the colour legend, but this time a different dialog box is presented – one in which the colour palettes are all sequential, they are however of two types:
Standard Sequential – these colour palettes are composed of a single colour and provide a gradient from light to dark.
Diverging sequential – these colour palettes are based on two or three colours, Tableau provides a gradient between the colours as shown below:
If you’re interested in creating your own colour palettes, go here.
Using Tableau can initially be a strange experience to some people. I believe this happens because views can be created so fast (see my earlier post) that it can sometimes feel like magic.
This post is intended to help Tableau users understand ‘how’ Tableau goes about interpreting your actions, and thus help you get the best from this wonderful product.