<?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 Re: parameterized variable for color in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407282#M805678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't pass a parameter that includes commas in the value.&amp;nbsp; The commas are always interpreted as parameter separators.&amp;nbsp; What you can do is add a DSE to calculate the numeric value of the RGB code and pass that. Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(vVar($(=num(rgb(241,82,73)))))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because RGB returns a Dual, you must extract the num otherwise QV will attempt to pass the string representation.&amp;nbsp; This is true even if you use script created variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vColor = RBG(1,2,3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vColorNum = num(RGB(1,2,3));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;$(vVar($(vColor)))&amp;nbsp; // won't work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;$(vVar($(vColorNum)))&amp;nbsp; // will work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update:&amp;nbsp; Actually, a color variable with a LET will work if you pass it as a direct reference, no DSE.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;$(vVar(vColor))&amp;nbsp; // will work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;That's because variables passed as parameters like this will be passed by reference, not value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com/" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com/" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Nov 2017 15:34:51 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2017-11-03T15:34:51Z</dc:date>
    <item>
      <title>parameterized variable for color</title>
      <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407278#M805673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to use parameterized variable with rgb color as a parameter. It seems the comma in the RGB() function is causing the issue and the expression is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have using this expression in the attached app to give background color to the dimension in chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=$(vVar(rgb(241,82,73))) //Not working&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vVar&amp;nbsp;&amp;nbsp; =if(sum(Sales) &amp;lt; 110,rgb(241,82,73))&amp;nbsp; //Actual expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please help!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407278#M805673</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: parameterized variable for color</title>
      <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407279#M805675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be create variable like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If($1=1, If(sum(Sales) &amp;lt; 110,rgb(241,82,73)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BG Color like &lt;STRONG&gt;$(vVar(1))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 13:29:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407279#M805675</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-03T13:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: parameterized variable for color</title>
      <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407280#M805676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anil...Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating this parameterised variable to improve the performance of my real expression which is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking to have the RGB function directly in the variable as a parameter. Do you think its not possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 13:47:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407280#M805676</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2017-11-03T13:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: parameterized variable for color</title>
      <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407281#M805677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I am thinking about how we can overcome this issue. May be &lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;‌ help you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 14:49:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407281#M805677</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-03T14:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: parameterized variable for color</title>
      <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407282#M805678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't pass a parameter that includes commas in the value.&amp;nbsp; The commas are always interpreted as parameter separators.&amp;nbsp; What you can do is add a DSE to calculate the numeric value of the RGB code and pass that. Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(vVar($(=num(rgb(241,82,73)))))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because RGB returns a Dual, you must extract the num otherwise QV will attempt to pass the string representation.&amp;nbsp; This is true even if you use script created variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vColor = RBG(1,2,3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vColorNum = num(RGB(1,2,3));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;$(vVar($(vColor)))&amp;nbsp; // won't work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;$(vVar($(vColorNum)))&amp;nbsp; // will work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update:&amp;nbsp; Actually, a color variable with a LET will work if you pass it as a direct reference, no DSE.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;$(vVar(vColor))&amp;nbsp; // will work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;That's because variables passed as parameters like this will be passed by reference, not value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com/" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com/" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 15:34:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407282#M805678</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-11-03T15:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: parameterized variable for color</title>
      <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407283#M805679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check if the attached works for you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 15:53:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407283#M805679</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-03T15:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: parameterized variable for color</title>
      <link>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407284#M805680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks you so much for the solution and the explanation..rockstar &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 16:36:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/parameterized-variable-for-color/m-p/1407284#M805680</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2017-11-03T16:36:56Z</dc:date>
    </item>
  </channel>
</rss>

