4 Replies Latest reply: Feb 15, 2018 3:15 AM by vishal raina

Hello all,

is there an option to dye numerative data gradualy.

so that e.g. 100% are colored "red" and 1% is colored "green".

I would be thankful for any advice.

greetings

daniel

• ###### color gradient

Hi,

I don't know whether I understood correctly, please check the attached image if you are expecting the same download QVW file from the below URL

http://ap.demo.qlik.com/QvAJAXZfc/opendoc.htm?document=qvdocs/Sales%20Management.qvw&host=Demo11

Refer Products tab and Margin (Heat chart)

Hope this helps you.

Regards,

Jagan.

• ###### Re: color gradient

Hi Jagah,

I was unable to find the qvw file at the mentioned URL. Could you help me with the same (or the expression) as i need it for conditional formatting in the same manner as shown by you in the picture above.

• ###### Re: color gradient

Daniel,

if you have a field with values between 0 and 1 (0 to 100 %), e.g. called Dye%, your background color attribute (e.g. in expression tab, open the attributes by clicking on the + sign next to the expression) could look like this:

=RGB(255* Dye% ,255-255* Dye%,0)

This looks like to be equivalent to using the colormix1 function:

=ColorMix1(Dye%,LightGreen(),LightRed())

If you want to get blue in the middle of the range, it could look like

=RGB(255*Dye%,255-255*Dye%,256-2*fabs(127-255*Dye%))

or (this looks different, more pure blue):

=colormix2(Dye%*2-1,LightGreen(),lightred(),LightBlue() )

Stefan

• ###### Re: color gradient

hi stefan,

thanks for your explanation. it was very helpful,

the "rgb" formula works fine in the range from 0 to 1        !

but how should a formula be defined , that

a) works in a range  form  " 0 to 100 "

and

b) is it although possible to dye dimensions, that are containing e.g. total amount of turnover?

greetings

daniel