Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
reddys310
Honored Contributor II

Re: Color Expression on stacked bar chart based on measure

You can colour a stacked bar chart in the following way. Take this as an Example.

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() )))

Check this for a QVF sample.

How to use custom colours in a stacked bar chart

Not applicable

Re: Color Expression on stacked bar chart based on measure

Hi Sangram,

I want to color a stacked chart which is having "department name" as dimension and "Count(users), Count(divisions)" as measures.

I have tried doing it in color expression editor but no use.

Could you suggest me the way to do it?

Awaiting.

kidbank3
Contributor III

Re: Color Expression on stacked bar chart based on measure

Sravanthi,

Does Sangram's solution work?  If yes, can you mark the answer as correct?

Not applicable

Re: Color Expression on stacked bar chart based on measure

No, It din't. I am just waiting for his reply.

Lech_Miszkiewicz
Honored Contributor III

Re: Color Expression on stacked bar chart based on measure

That is the current available solution. Sangram's answer should be marked as correct.

cheers

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
Not applicable

Re: Color Expression on stacked bar chart based on measure

I am unable to get it for the condition I have given above, could u pls suggest on my query

Lech_Miszkiewicz
Honored Contributor III

Re: Color Expression on stacked bar chart based on measure

Hi


Please Attach qvf file and we will get it working

cheers Lech
When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution.
Please LIKE threads if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem.
adandreti
New Contributor II

Re: Color Expression on stacked bar chart based on measure

Hello,

This solution works for me thanks, but now I am having a hard time sorting the way I would like. I was wondering if anyone could inform me on how to sort numerically descending based on the second value represented in my value list while deploying this color scheme? I have tried a couple "sort by expression's" but non give me the desired result.

Thx

adandreti
New Contributor II

Re: Color Expression on stacked bar chart based on measure

One way to achieve this is by creating a Master Item Measure for both of your measures. In creation of this measure you are able to select the color of your choice for each respective measure. Note that these colors will stay consistent throughout your app if you have them displayed in multiple sheets.

Community Browser