9 Replies Latest reply: Sep 13, 2014 10:52 AM by Marco Wedel RSS

    Colours

    Enrique Colomer

      Hi,

       

      I've this script:

       

      Set HidePrefix='%';

      Base:

      LOAD * INLINE [

          %Color Scheme, Color_A, Color_B, Flag

          Blue, "RGB(52, 152, 219)", "RGB(41, 128, 185)", 1

          Bright Green, "RGB(46, 204, 113)", "RGB(39, 174, 96)", 1

          Orange, "RGB(230, 126, 34)", "RGB(211, 84, 0)", 1

          Red, "RGB(231, 76, 60)", "RGB(192, 57, 43)", 1

          Turquoise, "RGB(26, 188, 156)", "RGB(22, 160, 133)", 1

          Yellow, "RGB(241, 196, 15)", "RGB(243, 156, 18)", 1

          Purple, "RGB(155, 89, 182)", "RGB(142, 68, 173)", 1

          Light Pink, "RGB(224,130,131)","RGB(214,69,65)", 1

          Light Orange, "RGB(242,120,75)","RGB(249,105,14)", 1

          Navy Blue, "RGB(103,128,159)","RGB(52,73,94)",1

          Light Blue, "RGB(134,226,213)","RGB(101,198,187)",1

          Light Purple, "RGB(190,144,212)","RGB(142,68,173)",1

      ];

       

      And I would like a table of values Color_A and Color_B, addition to make the background color representing value

        • Re: Colours
          Manish Kachhia

          Can you give bit more idea about what you want please?

          i.e. how you want to use them?

          • Re: Colours
            Daniel Oberbillig

            this should work:

             

            =$(=Only(Color_A))

            • Re: Colours
              Enrique Colomer

              Is only a test

               

              In this moment works only if I select a color, but not in a box list or

              • Re: Colours
                Marco Wedel

                Hi,

                 

                when I read your post, I thought you had something like color calculations in mind.

                Maybe it's not what you're looking for, but nevertheless helps:

                 

                QlikCommunity_Thread_133199_Pic2.JPG.jpg

                 

                QlikCommunity_Thread_133199_Pic3.JPG.jpg

                 

                SET HidePrefix='%';
                Base:
                LOAD * INLINE [
                    %Color Scheme, Color_A, Color_B, Flag
                    Blue, "RGB(52, 152, 219)", "RGB(41, 128, 185)", 1
                    Bright Green, "RGB(46, 204, 113)", "RGB(39, 174, 96)", 1
                    Orange, "RGB(230, 126, 34)", "RGB(211, 84, 0)", 1
                    Red, "RGB(231, 76, 60)", "RGB(192, 57, 43)", 1
                    Turquoise, "RGB(26, 188, 156)", "RGB(22, 160, 133)", 1
                    Yellow, "RGB(241, 196, 15)", "RGB(243, 156, 18)", 1
                    Purple, "RGB(155, 89, 182)", "RGB(142, 68, 173)", 1
                    Light Pink, "RGB(224,130,131)","RGB(214,69,65)", 1
                    Light Orange, "RGB(242,120,75)","RGB(249,105,14)", 1
                    Navy Blue, "RGB(103,128,159)","RGB(52,73,94)",1
                    Light Blue, "RGB(134,226,213)","RGB(101,198,187)",1
                    Light Purple, "RGB(190,144,212)","RGB(142,68,173)",1
                ];
                
                tabTemp:
                CrossTable (ColorName, RGB)
                LOAD [%Color Scheme], Color_A, Color_B
                Resident Base;
                
                tabColorComponents:
                LOAD [%Color Scheme],
                    ColorName,
                    SubField(TextBetween(RGB,'(',')'),',') as ColorValue,
                    Dual(Pick(AutoNumber(RowNo(),AutoNumberHash128([%Color Scheme],ColorName,)),'R','G','B'),
                    AutoNumber(RowNo(),AutoNumberHash128([%Color Scheme],ColorName,))) as ColorComponent
                Resident tabTemp;
                
                DROP Table tabTemp;
                
                tabColorCalc:
                LOAD [%Color Scheme],
                    'RGB('&Concat(Color_Sum,' ,',ColorComponent)&')' as Color_Sum,
                    'RGB('&Concat(Color_Min,' ,',ColorComponent)&')' as Color_Min,
                    'RGB('&Concat(Color_Max,' ,',ColorComponent)&')' as Color_Max,
                    'RGB('&Concat(Color_Avg,' ,',ColorComponent)&')' as Color_Avg
                Group By [%Color Scheme];
                LOAD [%Color Scheme],
                    ColorComponent,
                    Sum(ColorValue) as Color_Sum,
                    Min(ColorValue) as Color_Min,
                    Max(ColorValue) as Color_Max,
                    Round(Avg(ColorValue)) as Color_Avg
                Resident tabColorComponents
                Group By [%Color Scheme], ColorComponent;
                

                 

                regards

                 

                Marco