One cannot overstate the importance of adding context to analysis. Take the example of having the headline number Average Call Time displayed on a dashboard. While this might clearly be an important metric for a call center, but on its own it portrays very little. As shown in the Dimensionless bar chart recipe in the preceding section, we used reference lines to add the context required to make the number meaningful. Sticking to the example of Average Call Time, we may also want to see alongside; a previous point in times position, the national or a competitor's average, the internal target, and so on. This recipe extends the use of reference lines further.
For this recipe, we will make use on inline data load which gives us the call bounce rates for different periods. Add the following code into the data load editor and reload the Qlik Sense application:
WebStats: LOAD * INLINE [ Period, BounceRate 1, 0.26 2, 0.25 3, 0.24 4, 0.24 5, 0.27 6, 0.28 7, 0.21 8, 0.34 9, 0.24 10, 0.25 ];
Upper Threshold
and set the Reference line expression to the following:=Avg(BounceRate)+Stdev(Total Aggr( Avg(BounceRate),Period))
Lower Threshold
and the expression:=Avg(BounceRate)-Stdev(Total Aggr( Avg(BounceRate),Period))
Average
and the expression to:=Avg(BounceRate)
The preceding chart is often referred to as a Statistical Process Control (SPC) chart. The upper and lower threshold reference lines set a boundary of normal operation. Data points that fall outside of these reference lines differ from the norm and are highlighted as such. The upper and lower limits are simply the average plus or minus the standard deviation. We use the Aggr
function to "pre-calculate" the average over the period dimension and then apply the Stdev
function to this number.
Definition: Standard deviation (represented by the symbol sigma, σ) shows how much variation or "dispersion" exists from the average (mean) or expected value. A low standard deviation indicates that the data points tend to be very close to the mean; high standard deviation indicates that the data points are spread out over a large range of values: