<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Optimization in Color Palette Calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Optimization-in-Color-Palette-Calculation/m-p/1412352#M426973</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I wanted to add functionality to allow user's to select between three pre-defined 18 color palettes. My solution was to create 3 sets of 18 variables, each holding an RGB value of the given color (e.g. vColorPalette1Color1=rgb(25,125,177), vColorPaletteColor2=rgb(92,146,70), vColorPalette2Color1=rgb(25,56,100), etc.). I also created another variable (vColorPalette) which would hold a value of 1, 2, or 3. This allows the user to switch their active color palette.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then set each of the 18 colors on each chart's Colors tab to use the following calculated expressions: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color1')&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color2')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;My question is if there is a better way to optimize these calculations. 18 of these expressions are calculated whenever a chart is re-drawn. One thing that I can think of is to store these expressions inside 18 new variables, e.g.:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vColor1=&lt;SPAN style="font-size: 13.3333px;"&gt;$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color1')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vColor2=&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color2')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;and then use these new variables in the calculation for each color. Would doing this make it so that each of these expressions only get calculated once, or will this just slow things down further?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Sep 2017 22:21:17 GMT</pubDate>
    <dc:creator>dselgo_eidex</dc:creator>
    <dc:date>2017-09-25T22:21:17Z</dc:date>
    <item>
      <title>Optimization in Color Palette Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Optimization-in-Color-Palette-Calculation/m-p/1412352#M426973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I wanted to add functionality to allow user's to select between three pre-defined 18 color palettes. My solution was to create 3 sets of 18 variables, each holding an RGB value of the given color (e.g. vColorPalette1Color1=rgb(25,125,177), vColorPaletteColor2=rgb(92,146,70), vColorPalette2Color1=rgb(25,56,100), etc.). I also created another variable (vColorPalette) which would hold a value of 1, 2, or 3. This allows the user to switch their active color palette.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then set each of the 18 colors on each chart's Colors tab to use the following calculated expressions: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color1')&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color2')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;My question is if there is a better way to optimize these calculations. 18 of these expressions are calculated whenever a chart is re-drawn. One thing that I can think of is to store these expressions inside 18 new variables, e.g.:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vColor1=&lt;SPAN style="font-size: 13.3333px;"&gt;$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color1')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vColor2=&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color2')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;and then use these new variables in the calculation for each color. Would doing this make it so that each of these expressions only get calculated once, or will this just slow things down further?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Sep 2017 22:21:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimization-in-Color-Palette-Calculation/m-p/1412352#M426973</guid>
      <dc:creator>dselgo_eidex</dc:creator>
      <dc:date>2017-09-25T22:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization in Color Palette Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Optimization-in-Color-Palette-Calculation/m-p/1412353#M426974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, It is there. when we need to set up 18 colors of variables need to set up into one variable. So, instead of that i would prefer to use in Color section from script environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then we can called up as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pick(Match(Field, 'Value1','Value2','Value3',.......), $(&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;vColorPalette1Color1), $(&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;vColorPalette2Color1), $(&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;vColorPalette3Color1),......)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;This statement used for matching the values from different into colors of text and BG if needed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;HTH&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2017 01:36:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimization-in-Color-Palette-Calculation/m-p/1412353#M426974</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-09-26T01:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Optimization in Color Palette Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Optimization-in-Color-Palette-Calculation/m-p/1412354#M426975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I'm a little confused as to what you are saying. It sounds like you are assigning colors to field values? That isn't the problem I am facing, I already have a method for managing that. I want to be able to allow the end-user to select between different color palettes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Essentially my question is how does QlikView evaluate variables. For instance, let's say that I want the first color in the palette to be rgb(25,125,177). &lt;SPAN style="font-size: 10pt;"&gt;If I have the color expression be &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=$(='vColorPalette' &amp;amp; $(vColorPalette) &amp;amp; 'Color1') then it will calculate every time. But if I store that expression in a variable (vColor1), does QlikView remember the value of that variable and avoid the calculation?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2017 14:02:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Optimization-in-Color-Palette-Calculation/m-p/1412354#M426975</guid>
      <dc:creator>dselgo_eidex</dc:creator>
      <dc:date>2017-09-26T14:02:03Z</dc:date>
    </item>
  </channel>
</rss>

