Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)
Anonymous
Not applicable
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()))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)
Anonymous
Not applicable
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?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)
Anonymous
Not applicable
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 !

Anonymous
Not applicable
Author

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