Statistical Process Control Charts

I’ve had this idea for a while now – create a blog post and video tutorial discussing what Statistical Process Control is and how to use different Control Chart “tests” in Tableau.

I’ve spent a significant portion of my professional career in business process improvement and always like it when I can integrate techniques learned from a discipline derived from industrial engineering and apply it in a broader sense.

It also gives me a great chance to brush up on my knowledge and learn how to order my thoughts for presenting to a wide audience.  And let’s not forget: an opportunity to showcase data visualization and Tableau as the delivery mechanism of these insights to my end users.

So why Statistical Process Control?  Well it’s a great way to use the data you have and apply different tests to start early detection.  Several of the rules out there are aimed at finding “out-of-control,” non-normal, or repetitive parts within a stream of data.  Different rules have been developed based on how we might be able to detect them.

The video tutorial above goes through the first 3 Western Electric rules.  Full details on Western Electric via Wikipedia: here.

Rule 1: Very basic, uses the principle of a bell curve to put a spotlight on points that are above or below the Upper Control Limit (UCL) or Lower Control Limit (LCL) also known as +/- 3 standard deviations from the mean.  These are essentially outlier data points that don’t fall within our typical span of 99.7%.

Rule 2: Takes into consideration surrounding observations.  Looking at 3 consecutive observations are 2 out of 3 above or below the 2 SD mark from the average.  In this rule the observations must be on the same side of the average line when beyond 2 SD.  Since we’re at 95% at 2 SD, having 2 out of 3 in a set in that range could signal an issue.

Rule 3: Starts to consider even more data points within a collection of observations.  In this scenario we’re now looking for 4 out of 5 observations +/- 1 SD from the average.  Again, we’re retaining the positioning above/below the average line throughout the 5 points.  This one really shows the emergence of a trend.

I applied the first 3 rules to my own calorie data to see detect any potential issues.  It’s very interesting to see the results.  For my own particular data set, Rule 3 was of significant value.  Having it in line as the new daily data funnels in could prevent me from going on a “streak” of either over or under consuming.


Interact with the full version on my Tableau Public profile here.

Quick and easy – parameters to aggregate dates

(Now with video – video uses different data as an example)

One of my favorite uses of parameters is to dynamically change date aggregations without the pesky drill symbol.  Sometimes I want to just see week or month, quarters tend to be pretty worthless.  Especially if I’m doing something discrete, I really don’t like the way Tableau breaks apart the data view.

The creation of the parameter leaves me with a very clean user experience and ensures users don’t negatively interact with the viz.

Here’s the setup – first create a parameter of data type string and type in your allowed values.  Mine is going to have week and month:


(note I changed the casing on the words later on for look/feel)

Next create custom dates based on your primary date field.  Mine is called “Start”:


Right click on the field, go to Create -> Custom date…

For the sake of this viz, I made both a Months and Weeks (both are date value).  At one point I had days (shown as “Exact”, but I abandoned it)

Last step is create the calculated field.  Right click on the parameter at the bottom, create calculated field:


Place it on your designated shelf.  You may have to do some wrangling on the field to get it to display right.  For the viz I ended up with, the field is set to “Exact Date” and “Discrete.”

Check out the final experience below: