To make a statistical process control chart (SPC), or similar in Qlik Sense, it seems like we should have several options to make attractive-looking charts, but I'm having some trouble getting the colors set-up.
There are some interesting posts on doing these with QlikView, and so I'd really like to get one working with Sense. Here's a couple of posts from here on the Community Forums that are related:
- My Fav (used below) --> Control Chart
- QlikView Experts: Control Chart Challenge
- QlikView Control (SPC) Chart
I went ahead and used the Qlik Sense Converter for the "Control Chart" (downloaded .qvf file), and it's got some basic data, as well as having a few variables defined. ...Notably, there's a "vLCL", "vAvgLine", and "vUCL", which are defined for the Lower, Average, and Upper Control Limits, respectively based on a couple of standard deviations.
So, I've been able to use these to set up the Line Chart below, but (A.) when I use the Color By Expression with Colormix1(), it doesn't seem to work to assign colors to the datapoints across the line, and (B.) the Diverging Gradient is not user-configurable (at least don't think it is).
Is there any way to assign a gradient-based color to the datapoints on an SPC chart like this? It looks a lot neater with a gradient, IMHO. ...In the example below, you can see the UCL in RED and the LCL in GREEN, but the datapoints only in the BLUE-to-RED default diverging gradient. ...Specifically, is there anyway to assign (for instance), Green-to-Red gradient to the datapoints?
Does anyone know if this is possible?
Alternately, if there are any stats gurus out there that can say that it's practice to have Green/Red, or two-color-only, please let me know.
Edit: Currently, working on a colormix1() formula like this, but no version of it seems to work (it assigns either full-green or full-red or another straight color to all datapoints):
if( ((((sum(Sales)-vAvgLine)/vAvgLine) + 1) >1, 1,
if( ((sum(Sales)-vAvgLine)/vAvgLine + 1) < 0 , 0,
(sum(Sales)-vAvgLine)/vAvgLine + 1 ))))
Control Chart.qvf 448.0 K