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: 
ecolomer
Master II
Master II

Different colors according to value

In the example:

The question to be resolved is pointing different colors (green or red) values in a table as are above or below the total baseline.

The reference table contains a dimension "Product" and an expression: "% / Total", calculated as

Sum (Amount) / Sum (TOTAL <Country> Amount)

If you select a Country in the column Total you have the efect but not in each column in right

p60.png

And when you select a country, the efect over total column is ok, but not over the columns

p61.png

Tx

1 Solution

Accepted Solutions
rubenmarin

Hi Enrique, try with this color expression:

if(Sum(Amount)/Sum(TOTAL <Country> Amount) >

     Sum(TOTAL <Product> {<Country=>} Amount)/Sum(TOTAL {<Country={'*'}>} Amount), rgb(200,255,200), rgb(255,200,200))

Btw, when there are no countries selected, all totals are in red because the comparion in the if is equal ('='), so it's not '>' and goes to the else.

View solution in original post

2 Replies
rubenmarin

Hi Enrique, try with this color expression:

if(Sum(Amount)/Sum(TOTAL <Country> Amount) >

     Sum(TOTAL <Product> {<Country=>} Amount)/Sum(TOTAL {<Country={'*'}>} Amount), rgb(200,255,200), rgb(255,200,200))

Btw, when there are no countries selected, all totals are in red because the comparion in the if is equal ('='), so it's not '>' and goes to the else.

lironbaram
Partner - Master III
Partner - Master III

Reply

have a look at the attach example