Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to create a line chart that is following the colors as how is visualised in the below chart.
- Red when it is below target
- Green when it is above target
Is this possible in Qlik Sense?
If you have the Target expression stored in the first expression, and the the 2020 value stored in the second expression, you can use this for the "Background Color" of the 2020 expression:
=if(NOT len(column(1))>0,DarkGray(),
if(column(2)>=column(1),Green(),Red()))
This will produce this chart:
sample qvw is attached.
Put below expression as shown in image
=if(YourExpression>TargetEpression, Green(),lightred())
Is it possible to do this in Qlik Sense yet?
Kushal's answer is basically the only answer I can find, but for no obvious reason it sets the colour of both measures, which looks terrible.
Creating a master measure for the line expression and creating a master measure for the bar expression, and then setting the colour for both of them, is both annoyingly fiddly, adding countless extra steps to what should be a simple process, and also, doesn't work.
Because you can't set an expression for the colour in the master measure, and the expression in the chart settings just overrides whatever you've set in the master measure.
I feel like having some kind of threshold line on a bar chart with conditional colour for the bars based on whether they are above or below the line is pretty noddy stuff. I KEEP running into hurdles like this with Sense, and it's honestly doing my nut.