Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color by as a % of total

Hi,

New to Qlik Sense but have used other visualization products and have a simple request. I need to create a color by expression that will color my chart if the segments are more than 10% of the total. My example is I have product sales and if any products individual sales are over 10% of the total sales than color them a different color than all the rest. How do I evaluate each individually as part of the total?Qlik - color by.jpg

2 Replies
pbk
Employee
Employee

Edit the visual, go to Properties, Appearance, Colors and Legends.

Change the color from 'Auto' to Custom, and select By Expression.

for your example, use:

If (sum([Sales]) > sum(total [Sale]) * .1,

    lightgreen(),  //or an RGB color. this is the True condition

    lightred()  //or the color of your choice. this is the false condition

    )

If you always want to color based on the total sales regardless of what is selected, then change the expression to:

If (sum([Sales]) > sum( {1} total [Sale]) * .1,

    lightgreen(),  //or an RGB color

    lightred()

    )

Not applicable
Author

Thanks Paul. Worked great! Qlik -w color exprs.jpg