<?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: Set different color depending on the variable's value in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807371#M1212233</link>
    <description>&lt;P&gt;Hello Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;,&amp;nbsp;how are you?&lt;/P&gt;&lt;P&gt;Thanks for your kindly support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think doing something like this "&lt;SPAN&gt;Pick(Match(vAirComp1, 'AZU', 'GLO'),&amp;nbsp;RGB(14,43,88),RGB(255,112,32))&lt;/SPAN&gt;" will improve performance because I've lots of different airlines, about 40 different &lt;SPAN&gt;vAirComp1&lt;/SPAN&gt;, so 40 different rgb colors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm already using a script where I created an inline load statement, and defined a key field and its colors... something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD * INLINE [
	NCIA,AIRN,AIRC,RRRR,GGGG,BBBB
	AJB,American Jet,Argentina,120,45,145
...
	NAA,Norwegian Air Argentina,Argentina,216,25,57
	AZN,Amaszonas,Bolivia,0,166,81
...
	VNE,Venezolana,Venezuela,11,175,42
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, everytime the user selects an specific NCIA, I'm able to college its associate color.&lt;/P&gt;&lt;P&gt;My variable called vAirComp1 is related somehow to NCIA, and it's defined as:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=SubField(GetFieldSelections(NCIA, ' - ', 5),' - ',1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My intention is to set the colors of vAirComp1 (depending on its value) as already defined on my inline load statement... but I have no idea how to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you think about it?&lt;BR /&gt;Is it possible to work with colors and variables on load script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 12 May 2021 14:10:12 GMT</pubDate>
    <dc:creator>brunolelli87</dc:creator>
    <dc:date>2021-05-12T14:10:12Z</dc:date>
    <item>
      <title>Set different color depending on the variable's value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807126#M1212208</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;I created a variable called &lt;STRONG&gt;vAirComp1&lt;/STRONG&gt;, with the following expression in order to collect the first item selected on the field called NCIA.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=SubField(GetFieldSelections(NCIA, ' - ', 5),' - ',1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And once the user can select as many NCIAs as possible, I'm using the following background color expression in order to color my chart line based on the user's selection (&lt;STRONG&gt;vAirComp1 value&lt;/STRONG&gt;).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(vAirComp1='AZU',RGB(14,43,88),
if(vAirComp1='GLO',RGB(255,112,32),
if(vAirComp1='PTB',rgb(255,213,3),
if(vAirComp1='ARG',rgb(0,173,239),
if(vAirComp1='SKU',rgb(89,35,127),
if(vAirComp1='VVC',rgb(255,219,0),
if(vAirComp1='EFY',rgb(254,118,17),
if(vAirComp1='BOV',rgb(13,42,98),
if(vAirComp1='BWA',rgb(175,38,120),
if(vAirComp1='RPB',rgb(103,51,205),
if(vAirComp1='NSE',rgb(211,52,53),
if(vAirComp1='SRU',rgb(74,90,97),
if(vAirComp1='FBZ',rgb(254,190,16),
if(vAirComp1='THT',rgb(45,204,211),
if(vAirComp1='VTA',rgb(223,0,43),
if(vAirComp1='ECO',rgb(0,173,238),
if(vAirComp1='ACL',rgb(108,18,64),
if(vAirComp1='VCV',rgb(239,126,42),
if(vAirComp1='DAP',rgb(45,45,46),
if(vAirComp1='ROR',rgb(253,230,0),
if(vAirComp1='RYL',rgb(11,70,150),
if(vAirComp1='SRC',rgb(38,73,110),
if(vAirComp1='TGY',rgb(0,35,93),
if(vAirComp1='SID',rgb(47,57,117),
if(vAirComp1='MWM',rgb(147,200,70),
if(vAirComp1='JAT',rgb(158,32,45),
if(vAirComp1='WAY',rgb(103,51,205),
if(vAirComp1='AZN' or vAirComp1='AZP',rgb(0,166,81),
if(vAirComp1='AVA' or vAirComp1='TPA',rgb(2219,19,25),
if(vAirComp1='LAN' or vAirComp1='LCO',rgb(230,51,88),
))))))))))))))))))))))))))))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But as you can see, there are lots of IFs statements...&lt;BR /&gt;&lt;BR /&gt;Is there any better way of doing this?&lt;BR /&gt;I'm pretty sure I'm not using the smartest solution...&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 20:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807126#M1212208</guid>
      <dc:creator>brunolelli87</dc:creator>
      <dc:date>2021-05-11T20:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Set different color depending on the variable's value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807163#M1212209</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/114998"&gt;@brunolelli87&lt;/a&gt;&lt;/P&gt;&lt;P&gt;You can try with Pick(Match()) like below&lt;/P&gt;&lt;P&gt;Pick(Match(vAirComp1, 'AZU', 'GLO'),&amp;nbsp;RGB(14,43,88),RGB(255,112,32))&lt;/P&gt;&lt;P&gt;Or, you can bring color field in the script &amp;amp; use it in front end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 03:53:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807163#M1212209</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-05-12T03:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set different color depending on the variable's value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807371#M1212233</link>
      <description>&lt;P&gt;Hello Mr.&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;,&amp;nbsp;how are you?&lt;/P&gt;&lt;P&gt;Thanks for your kindly support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think doing something like this "&lt;SPAN&gt;Pick(Match(vAirComp1, 'AZU', 'GLO'),&amp;nbsp;RGB(14,43,88),RGB(255,112,32))&lt;/SPAN&gt;" will improve performance because I've lots of different airlines, about 40 different &lt;SPAN&gt;vAirComp1&lt;/SPAN&gt;, so 40 different rgb colors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm already using a script where I created an inline load statement, and defined a key field and its colors... something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD * INLINE [
	NCIA,AIRN,AIRC,RRRR,GGGG,BBBB
	AJB,American Jet,Argentina,120,45,145
...
	NAA,Norwegian Air Argentina,Argentina,216,25,57
	AZN,Amaszonas,Bolivia,0,166,81
...
	VNE,Venezolana,Venezuela,11,175,42
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, everytime the user selects an specific NCIA, I'm able to college its associate color.&lt;/P&gt;&lt;P&gt;My variable called vAirComp1 is related somehow to NCIA, and it's defined as:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=SubField(GetFieldSelections(NCIA, ' - ', 5),' - ',1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My intention is to set the colors of vAirComp1 (depending on its value) as already defined on my inline load statement... but I have no idea how to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you think about it?&lt;BR /&gt;Is it possible to work with colors and variables on load script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 12 May 2021 14:10:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807371#M1212233</guid>
      <dc:creator>brunolelli87</dc:creator>
      <dc:date>2021-05-12T14:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set different color depending on the variable's value</title>
      <link>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807540#M1212256</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/114998"&gt;@brunolelli87&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PFR, hope it helps&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Assign-load-script-applymap-values-to-variable-for-chart-colors/m-p/38025" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/Assign-load-script-applymap-values-to-variable-for-chart-colors/m-p/38025&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Use-colors-from-variables/td-p/1150701" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/Use-colors-from-variables/td-p/1150701&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 00:44:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-different-color-depending-on-the-variable-s-value/m-p/1807540#M1212256</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-05-13T00:44:04Z</dc:date>
    </item>
  </channel>
</rss>

