Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Color the bar chart with specific colors

Good Morning!

I have a chart with two references, "Planned," "Unplanned." I would like the reference "Planned" to be Green in the chart and the reference "Not Planned" would be red.

Planejadas:

Count({<[TipodeManutenção] = {'Preventiva Baseada no Tempo'}>}[TipodeManutenção])/Count({<[TipodeManutenção] = {'Preventiva Baseada no Tempo','Preventiva Baseada na Condição','Corretiva'}>}[TipodeManutenção])

Não Planejadas

Count({<[TipodeManutenção] = {'Preventiva Baseada na Condição','Corretiva'}>}[TipodeManutenção])/Count({<[TipodeManutenção] = {'Preventiva Baseada no Tempo','Preventiva Baseada na Condição','Corretiva'}>}[TipodeManutenção])

grafic.JPG

1 Reply
rittermd
Honored Contributor

Re: Color the bar chart with specific colors

It is a little complicated.  But can be done.  You would need to modify these with your values.

You need to add a 2nd Dimension using ValueList function like

ValueList('Admit','DC','Gain')

Then modify your measure like this:

if(ValueList('Admit','DC','Gain')='Admit'

  ,Avg(MeasureValueStart)

  ,if(ValueList('Admit','DC','Gain')='DC'

     ,Avg(MeasureValueEnd)

     ,Avg(Gain)

     )

  )

Then under Appearance/Colors you need to do by Expression and use something like this:

if(ValueList('Admit','DC','Gain')='Gain'

  ,rgb(0,255,0)

  ,if(ValueList('Admit','DC','Gain')='Admit'

     ,rgb(0,0,192)

     ,rgb(192,0,0)

     )

  )