Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I am struggling to colour a stacked bar chart in custom colours. If you take belows chart as an example, I would like to e.g. replace the green with black, the purple with turquoise etc.
This example chart is auto-colour by QlikSense in the multicolored>12 colors mode.
I defined my custom colours as e.g. "kGreen", "kBlue" and usually use nested if-expressions to custom-colour my charts.
With the stacked bar chart, however, the issue is that my six different measures are six columns of the same facts table and the if-statements don't work.
Thank you very much for your help!
Hi David,
This should be an easy way to achieve this.
Find the sample qvf attached.
- Sangram
Hello,
I am struggling with a "problem" in Qlikview Could someone help me please ?
I have created a stacked bar chart. 2 expressions and 2 dimensions, one is year-month and one is calculated (3 VALUES, 'achieved', 'justmissed' and 'missed'). I would like to display 'achieved' in green, 'justmissed' in yellow and 'missed' in red.
To achieve this, I have created 2 variables:
and the definition back ground color of the first expression is $(vBenchColor)
BUT the 3 segments are RED.
thank you very much
Nasser
Hi Nasser,
Use these expressions:
Dimension 1: year-month
Dimension 2: valuelist( 'achieved', 'justmissed' and 'missed')
Measure : if(valuelist( 'achieved', 'justmissed' and 'missed') = 'achived',<expression1>,
if(valuelist( 'achieved', 'justmissed' and 'missed') = 'justmissed',<expression2>,
if(valuelist( 'achieved', 'justmissed' and 'missed') = 'missed',<expression3> )))
Colour Expression:
if(valuelist( 'achieved', 'justmissed' and 'missed') = 'achived',lightgreen(),
if(valuelist( 'achieved', 'justmissed' and 'missed') = 'justmissed',yellow(),
if(valuelist( 'achieved', 'justmissed' and 'missed') = 'missed',lightred() )))
Hi Sangram,
thank you very much for you quick answer.
I am trying to implement your solution but I don't know what is the expression1, expression2, expression3 in the measure.
I have 2 measures
so what do you mean about expression1, expression2, expression3 ?
Many thanks
Hi Nasser,
Is it possible to attach a sample qvf so it will be easier to explain?
Thanks
Sangram
One more thing,
Am I right that the values in the field action is as follows:
Action
'Achieved'
'Just Missed'
'Missed'
?
Hi Sangram,
I would like, but I just have a qvw file. I am working in a qlikview application (not qlik sens).
do you want me to send you the qvw file ?
Nasser
No exactly.
An action is just a number (primary key). An action has an attribute "bench" which can be Achieved, Just Missed or Missed. let's consider (as an example) 99 actions (77 achieved + 10 Just Missed and 12 Missed) in march
The purpose is to display this bar
Hi Nasser,
QVW would be great 🙂
Thank you.
Assuming that values in the field Action are -> Bench = Achieved, JustMissed and Missed.
Try these expressions:
Dimension 1: year-month
Dimension 2: Action
Measure : if(Action = 'achieved',Count({$< Action = {'achieved'} >}Action),
if(Action = 'justmissed',Count({$< Action = {'justmissed'} >}Action),
if(Action = 'missed',Count({$< Action = {'missed'} >}Action) )))
Colour Expression:
if(Action = 'acheived', lightgreen(),
if(Action = 'justmissed', yellow(),
if(Action = 'missed', lightred() )))