If you are here it is because you either already know how to create a Control Chart in Tableau or have followed from my previous blog on that subject and now want to find out how to take your Control Chart to the next level.

 

In this post I will show you how to use a calculated set of control limits to highlight outliers, also how to give your end users a level of control over the extent of the control limits applied. If you don't know how to create your calculated control limits please check out my earlier blog post - Control Charts in Tableau.

To follow the rest of this blog you will need to have created your Control Chart with calculated fields rather than drag and drop from the Analytics Pane - if not please follow my previous blog post on how to do this.

 

While a simple Control Chart gives you the ability to identify outliers wouldn't it be nicer if it made it pretty obvious that something is amiss?

 

Simply put we just want to know if a value on our measure line is greater than the upper control or less than the lower control limits we have calculated. Because the upper and lower control limit fields are table calculations by default this calculation will be also.
Outlier
Sum
([Sales]) < [Lower_Control_Limit]
OR
Sum([Sales]) > [Upper_Control_Limit]

 

We can simply add this field to colour on the marks card, however this gives an output that i don't find particularly friendly.

outlier on colour

 

Yes it works but there is a nicer version of this chart, and we achieve it by creating a duplicated measure dual axis chart. If you don't know how to do this you can watch the short clip below.

 

The benefit of doing this is that we now have the same measure with two separate marks cards, meaning we can overlay two different visual type on top of one another. To tidy this chart up now we are going to remove colour from the first Sum([Sales]) marks card and change the Sum([Sales])(2) mark type to be a circle.

 

We now have our Control Chart with blue circles when within the control limits and orange circles outside, of course now you can use the two marks cards to change the thickness of lines, size of circles and the colour scheme to what works for you.

 

In this one below I have made the line thinner the circles slightly larger and made the circles within the control limits the same colour as the line, I also hid the second axis (right click on axis and untick "Show Header").

end spc with circles

The next little trick we can talk about is giving your end users a bit of control, by using a parameter we can control how many standard deviations from the average we want our control limits set (we can go far further than this, switching between mean and standard deviations to median and quartiles - but that is for another time).

 

list paramrange param First we need to create our parameter, for this example i'm going to allow my users to select 1,2 or 3 standard deviations form the average. You can create this parameter 2 ways, as a range or list, the range option limits the ways in which your user can interact to "Type In" and "Slider", by using a list they have both of these but also "Single Value List" and "Compact List", but you will have to enter every option (not so bad in this case).

Then use the parameter in our control limit calculations, editing them to multiply the standard deviations by the parameter value..

 

(Note: you don't need to bracket the multiplication as it will take place before the addition or subtraction following standard maths rules)

Upper_Control_Limit
[Control Average] + WINDOW_STDEVP( Sum([Sales]) ) * [Standard Deviations]
Lower_Control_Limit
[Control Average] - WINDOW_STDEVP( Sum([Sales]) ) * [Standard Deviations]

 

The last thing to do is right click on your parameter and "Show Parameter Control" - because we want our users to be able to see and interact with it right :)

You should end up with something like this (I have set it to 2 standard deviations, giving us a single outlier).

end spc with dynamic limits

I hope you found this useful, the next couple of blogs will cover off advanced control charting, P Control Chart and how to implement Nelson rules in Tableau - warning this is very Table Calculation heavy!

If you'd like to find out more about how Biztory can help you with advanced charting in Tableau like this please send us a message!

Let's Talk

Author
Chris Dickson

Chris Dickson

I help you get insights from your data. Easier. Faster.

Read more articles of this author
Let's discuss your data challenges

Join our community of data enthusiasts

Get industry insights, expert tips and Biztory news sent straight to your inbox with our monthly newsletter.