Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Kingofghost33
Contributor II

Color expression Green And Red - Stacked bar chart

Hi,

I'm new in Qlik sense a have a little problem with a bar chart.

I've only 2 variables : etat_dispo (disponibility of a car part equals to 0 or 1) & Part_name (Part Name) 

 

Qlik clearly understand the data and show what i want but not in the good color !!! 1 - default graph with qlik.png

 

But when i tried to make the color in green or red it's a total mess.

If(Aggr(Sum({<etat_dispo = {'1'}>} etat_dispo), part_name) > 0, Green(), Red())

That's show this without the notion of available and unavailable :

 

graph_with_color_expression.png

 

Someone have a clue please ? I would like to have the has the graph one but with red and green...

thanks,

Leo

 

4 Replies
rubenmarin

Hi, you can create a master item for each measure, set color for each master measure, use them in chart and select to use the library colores for measures.

rubenmarin_1-1724568584770.png

 

 

Kingofghost33
Contributor II
Author

Hi @rubenmarin ,

 

Thanks for your answer, i already try this options.

 

I have 2 master measures : 

- One for availability (when etat_dispo = 1)

-One for unavailability (when etat_dispo = 0)

 

You can find in attachments what that did when i put color by measure. As you can see, color are not working.

nina2
Contributor III

Hi, 

you can create a master item with the field etat_dispo.

Then, you can open the master item again and define the colors you want for each value in the panel 'value colors'. 

Once you defined the defaut colors in the master item "Etat dispo", you can select "color by dimension" in  your bar chart and select the dimension created above

You can also clik and drag the master item on the bar chart and select the proposition "color by : Etat dispo"

Hope it's clear

Nina

rubenmarin

Hi @Kingofghost33, instead of 'Par mesure' use 'multicolor' or 'unique color'.

'By measure' colors using the result of the expression selected, it depends of the value calculated, not the fixed color set to the measure.

Also, set the color on the 'edit measure' panel, not in the color 'segment color' panel.

rubenmarin_0-1724912570250.png