1 Reply Latest reply on Jan 14, 2019 6:19 PM by swaroop.gantela

# Western Electric Rules Control Report Create Alerts

Hi Everyone!

I am still fairly new to Tableau, so I'm hoping there is an easy solution to my problem (and therefore I can laugh at it!)

Attached is an example workbook.

I have created a control report in the style of the Western Electric Rules and am having trouble working out the best way to create automatic alerts so that I don't have to keep referring to the charts.

Below is an example of the charts I have created, which shows the number of applications coming through each day:

• The time frame is 14 days
• The zones are divided by 1, 2 and 3 standard deviations

If we take Rule 1 as an example (1 data point lies outside of the 3 standard deviation zones), I believe the best way of approaching this is as follows:

• Calculated Field: IF [Applications] >= [UPPER 3 Standard Deviations] OR [Applications] <= [LOWER 3 Standard Deviations] THEN 1 ELSE 0 END   - > We call this 'Rule 1'
• Alert: Send email if Rule 1 is: Equal to 1

The issue I'm having with this is that this code will calculate for the whole time period of the data set, whereas I want it it to calculate for the last 14 days.

Now, I used the following code to calculate the standard deviation lines:

WINDOW_AVG(SUM([Applications])) - WINDOW_STDEV(SUM([Applications]))

This obviously changes as I change the date filter.

I am thinking my code should involve the WINDOW function?

I think I'm nearly there, just missing something to make everything click in my head!

Best,

Joe

• ###### 1. Re: Western Electric Rules Control Report Create Alerts

Joe,

Welcome to the Forums.

I may not have caught the gist,

but I think you can modify your rule calculation to look like:

IF SUM([Applications]) >= [Apps UB 3SD]

OR SUM([Applications]) <= [Apps LB 3SD]

THEN 1 ELSE 0 END

This will mark if a single point is beyond the 3SD UB/LB.

Then if you wanted to know if any point in the 14 day window

had gotten flagged, you can try, as you suggested, a WINDOW_SUM:

IF WINDOW_SUM([Rule3])>0 THEN 1 ELSE 0 END