Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Color by as a % of total


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

Tags (1)
2 Replies
Not applicable

Re: Color by as a % of total

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



Not applicable

Re: Color by as a % of total

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