<?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: Setting chart colours from field values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861845#M530630</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That should work but make sure there are no multiple values of one of the colors possible where you use the rgb expression. You probably can't use this in a chart object\properties color tab as these calculated colors are not evaluated by the dimension for example. Instead use the expression background color option by clicking on the + sign in front of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="90083" alt="BGColor.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90083_BGColor.png" style="height: 268px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Jun 2015 12:57:47 GMT</pubDate>
    <dc:creator>stigchel</dc:creator>
    <dc:date>2015-06-19T12:57:47Z</dc:date>
    <item>
      <title>Setting chart colours from field values</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861844#M530628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field - [Response/result] that contains either 'Green', 'Amber', 'Red' or 'None'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to be able to have my charts render red, amber or green based on this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We've created a new field in the extract that calculates the individual RGB numbers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Green', 173, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Amber', 255,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Red', 255, 255))) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[PQIColour_Red]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; ,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Green', 214, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Amber', 128,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Red', 0, 255))) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[PQIColour_Green]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; ,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Green', 44, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Amber', 0,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Response/result]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'Red', 0, 255))) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[PQIColour_Blue] &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;We've then attempted to use this in the colours of a chart using the following expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RGB&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;( &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PQIColour_Red&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PQIColour_Green&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;PQIColour_Blue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; ) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;But this returns Black - we're assuming it's being evaluated at RGB(0,0,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;We've create a list box with the same expression and it is showing as we'd expect - i.e. only four values:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RGB(255,255,255)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RGB(255,128,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RGB(255,0,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RGB(173,214,44)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;John&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 12:48:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861844#M530628</guid>
      <dc:creator>jag7777777</dc:creator>
      <dc:date>2015-06-19T12:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Setting chart colours from field values</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861845#M530630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That should work but make sure there are no multiple values of one of the colors possible where you use the rgb expression. You probably can't use this in a chart object\properties color tab as these calculated colors are not evaluated by the dimension for example. Instead use the expression background color option by clicking on the + sign in front of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="90083" alt="BGColor.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/90083_BGColor.png" style="height: 268px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 12:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861845#M530630</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-06-19T12:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Setting chart colours from field values</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861846#M530632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the approach described in this blog post: &lt;A href="https://community.qlik.com/qlik-blogpost/2831"&gt;Colors in charts&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 12:58:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861846#M530632</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-06-19T12:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Setting chart colours from field values</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861847#M530633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Piet - I was using the expression in the colours section. Moving it into the expression properties work perfectly!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 13:55:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861847#M530633</guid>
      <dc:creator>jag7777777</dc:creator>
      <dc:date>2015-06-19T13:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting chart colours from field values</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861848#M530634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome John, glad to be of help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another tip, you can also use the following instead of these nested if statements. (The +1 after the match is for the default value for any non matching value)&lt;/P&gt;&lt;P&gt;pick(match([Response/result],'Green','Amber','Red')+1,255,173,255,255) as [PQIColour_Red]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jun 2015 14:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-chart-colours-from-field-values/m-p/861848#M530634</guid>
      <dc:creator>stigchel</dc:creator>
      <dc:date>2015-06-19T14:19:01Z</dc:date>
    </item>
  </channel>
</rss>

