Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

reivax31
Contributor III

ColorMix Min and Max value

Hi Qlikers,

I'm using ColorMix1 in a table to change the background color. So it works fine when I have values from '0' to '1'. But in my table the min value and max value are very close (like 0.65 and 0.60). So the background color are nearly the same for 0.60 and 0.65. Is it possible to set le 0.60=0 and the 0.65=1? It needs to work if the value changes to 0.40 and 0.45 also.

Thanks for your help

Tags (1)
1 Solution

Accepted Solutions
brunobertels
Valued Contributor

Re: ColorMix Min and Max value

Hi XAvier

As Sangram said in fact no matter the scale or the difference between your max and min value as colormixx can take a mesure to calculate the 0 (min) and 1 ( Max value)

See exemple beloww and attached qvf file : (thanks to Mickael Torrelo who provided this exemple )

it's showing how to use variable to put color and colormix as variable to reuse them after in your app.

Here this exemple put 2 colors as variable blue and salmon :

vblue  : RGB(68,119,170)

vsalmon : rgb(250,128,114)

then this 2 colors are used in a colormix mesure :

Colormix1((sum([Sales])-$(=min(aggr( sum([Sales]), CategoryName))))/$(=(max(aggr( sum([Sales]),CategoryName))

-min(aggr( sum([Sales]), CategoryName)))),white(),$(vSalmon))

this is to adapt with you data with country for exemple :

Colormix1((sum([Sales])-$(=min(aggr( sum([Sales]), country))))/$(=(max(aggr( sum([Sales]),country))

-min(aggr( sum([Sales]), country)))),white(),$(vSalmon))

Regards

5 Replies
reddys310
Honored Contributor II

Re: ColorMix Min and Max value

Hi Xavier,

I can't see why its not possible. Is it possible to attach a sample QVF so that it would be easy to solve it?

Thank you,

Sangram

brunobertels
Valued Contributor

Re: ColorMix Min and Max value

Hi XAvier

As Sangram said in fact no matter the scale or the difference between your max and min value as colormixx can take a mesure to calculate the 0 (min) and 1 ( Max value)

See exemple beloww and attached qvf file : (thanks to Mickael Torrelo who provided this exemple )

it's showing how to use variable to put color and colormix as variable to reuse them after in your app.

Here this exemple put 2 colors as variable blue and salmon :

vblue  : RGB(68,119,170)

vsalmon : rgb(250,128,114)

then this 2 colors are used in a colormix mesure :

Colormix1((sum([Sales])-$(=min(aggr( sum([Sales]), CategoryName))))/$(=(max(aggr( sum([Sales]),CategoryName))

-min(aggr( sum([Sales]), CategoryName)))),white(),$(vSalmon))

this is to adapt with you data with country for exemple :

Colormix1((sum([Sales])-$(=min(aggr( sum([Sales]), country))))/$(=(max(aggr( sum([Sales]),country))

-min(aggr( sum([Sales]), country)))),white(),$(vSalmon))

Regards

reivax31
Contributor III

Re: ColorMix Min and Max value

Hi Bruno and Sangram,

I have added the qvf file and I tried the expression. But it stays in blank in my table...

Tanks for your support

brunobertels
Valued Contributor

Re: ColorMix Min and Max value

Hi

I have a glance to your posted file it seems thats Target M50 and Target A50 are not values that can be or need to be summurize but dimension ?

For MSN 0005 there is only possible value with target M50 0,6 and so on

You must have several value to summurize to use with colormixx function

Bruno

reivax31
Contributor III

Re: ColorMix Min and Max value

Hi bruno,

I will have to find a way to go around or build my table differently.

Thanks for your support