5 Replies Latest reply: Jan 25, 2016 2:33 AM by xavier hemelaar RSS

    ColorMix Min and Max value

    xavier hemelaar

      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

        • Re: ColorMix Min and Max value
          Sangram Reddy

          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

          • Re: ColorMix Min and Max value
            bruno bertels

            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

            • Re: ColorMix Min and Max value
              xavier hemelaar

              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