Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All 🙂
I have a process control chart and would like to highlight the data points say for example if 6 points are consecutively on one side of the mean however I am unsure how to write this.
Please see pic to see what I would like to highlight, many thanks! 😄
This is not pretty, but it should work. You would use the Above function to check previous and following points. Set as Color as Expression. This is the start. You would need to finish the combinations where I have . . . and replace Value and SDate with you measure and dimension.
if((sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),4)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),5)>(sum(Total Value)/count(Distinct Total SDate))) or
(sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),4)>(sum(Total Value)/count(Distinct Total SDate))) or
(sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate))) or
. . . .
,Red(),Black())
I believe that is likely going to need Set Analysis, but I am not sure, the following may help if that is the case:
https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344
https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822
Here is the Help link to it too:
Sorry I am not more help, I am not very good at the dev side of things, more of a backend guy, apologies.
Regards,
Brett
This is not pretty, but it should work. You would use the Above function to check previous and following points. Set as Color as Expression. This is the start. You would need to finish the combinations where I have . . . and replace Value and SDate with you measure and dimension.
if((sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),4)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),5)>(sum(Total Value)/count(Distinct Total SDate))) or
(sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),4)>(sum(Total Value)/count(Distinct Total SDate))) or
(sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate))) or
. . . .
,Red(),Black())
This isn't pretty, but it should highlight the correct values. In Color by Expression, this uses the Above function to check previous and following values. This is just the start, you will need to finish the pattern for possible combinations where I have . . . and replace Value with your measure and SDate with you Dimension.
if((sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),4)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),5)>(sum(Total Value)/count(Distinct Total SDate))) or
(sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),4)>(sum(Total Value)/count(Distinct Total SDate))) or
(sum(Value)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),-1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),1)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),2)>(sum(Total Value)/count(Distinct Total SDate)) and
above(sum(Value),3)>(sum(Total Value)/count(Distinct Total SDate))) or
. . . .
,Red(),Black())