Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
NEW webinar Dec. 7th: 2023 Outlook, A Pivotal Year for Data Integration SIGN ME UP!
cancel
Showing results for 
Search instead for 
Did you mean: 
gbangsboll
Contributor II
Contributor II

Color expression for stacked bar chart (expression measures) - Qlik Sense Desktop

Hi Qlik Community!

Fairly new Qlik Sense user and first time posting in the community.

I have a stacked bar graph with a single Dimension.  There are three measures of the expression form: count({<[Claim Priority]={'High'}>} [Claim Priority])    (other two just have "High" changed to "Medium" and "Low", respectively).

Essentially, for each Dimension I have the full count of the field "Claim Priority" stacked into their High, Medium, and Low counts.  I would like the colors of each of these to be red, yellow, green, respectively.

Using the multicolored selection for Appearance->Colors does get the graph into the three distinct colors but not the colors I am hoping for. Current state of the graph can be seen here:

QlikCommunityQuestion2.PNG

I think using Colors By Expression is what I need to do, but the following expression leads to the below graph:

if(([Claim Priority]='High'),red(),(if(([Claim Priority]='Medium'),yellow(),green())))

QlikCommunityQuestion1.PNG

Could you please help me out with this?  Some digging around has indicated I may need to include a step in the data load script but if I can just adjust the color expression that would be the preferred route.

Thanks!

1 Solution

Accepted Solutions
h_prakash
Creator II
Creator II

Hi Garrett,

In this case you need to create a synthetic Dimension by using Valuelist Function. If you have a Qlik Sense Version of 3.2. There you can create a Individual measures in the Master Items and assign specific colors. For Now I have created using synthetic dimension and assigned colors. Hope this helps you.

Thanks

hari !

View solution in original post

8 Replies
Anil_Babu_Samineni

Your condition is not correct, Use this

if([Claim Priority]='High',red(),if([Claim Priority]='Medium',yellow(),green())

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
gbangsboll
Contributor II
Contributor II
Author

Thanks for your prompt reply Anil!

I tried that and it indicated an expression error.  It just needed an extra ")" at the end, but even with that the graph remained as the second image in my post.

Anil_Babu_Samineni

May be typo error by end

if([Claim Priority]='High',red(),if([Claim Priority]='Medium',yellow(),green()))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
gbangsboll
Contributor II
Contributor II
Author

That extra ")" was what I had added and it still results in the second image shown in my initial post.

Anil_Babu_Samineni

Can you add QVF, Please?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
gbangsboll
Contributor II
Contributor II
Author

File added to original post - thank you.

h_prakash
Creator II
Creator II

Hi Garrett,

In this case you need to create a synthetic Dimension by using Valuelist Function. If you have a Qlik Sense Version of 3.2. There you can create a Individual measures in the Master Items and assign specific colors. For Now I have created using synthetic dimension and assigned colors. Hope this helps you.

Thanks

hari !

gbangsboll
Contributor II
Contributor II
Author

Thank you! That is a great feature to know - I really appreciate your help.