Reference lines in a Sales versus Target gauge chart
Recently, while delivering a proof of concept, I was asked by a customer if we could create a "Stephen Few Bullet chart" in Sense. This is not possible out of the box, for the simple reason that a bullet chart involves overlaying a bar chart on top of a gauge chart, and overlaying objects in Sense is not allowed. So, I thought of delivering the same result using just the gauge chart and making use of reference lines.
Getting ready
Load the following script in the Qlik Sense Data load editor
; it gives information about theSales
andTarget
values for four countries:
LOAD * INLINE [ Country, Sales, Target USA, 10000, 8500 UK, 7000, 9500 Germany, 5000, 4500 Japan, 6000, 6000 ];
How to do it…
- Drag a
Gauge
chart object onto the sheet from the Assets panel on the left. - Click on
Add measure
and type in the following expression. Label it asSales vs Target
:
Sum(Target)
- Under
Add-ons
, click on theReference lines
and add aÂReference line
expression
...