<?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 Dynamic line chart background colours in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-line-chart-background-colours/m-p/749886#M534548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a line chart of historic data, volume plotted against 'Historic Week Start Date'. I want my line colour to change based on historic Fiscal Year. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have currently achieved this by hard coding in the following in the Background Colour section of my expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(HistoricalFiscalYear='FY11',rgb(70,137,164),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY12',rgb(171,167,17),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY13',rgb(141,25,8),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY14',rgb(236,129,0),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY15',rgb(114,85,37))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This achieves the intended result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75930_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, to account for the possibility of the data being loaded in for more / different fiscal years, I would like to make this expression dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another field, 'HistoricalFYRow' which is a row count, which could potentially be used in the expression (as was finding it difficult to do max / min on the fiscal year field (FY11, FY12...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions of how to modify this formula, perhaps with a variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Mel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jan 2015 14:41:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-22T14:41:18Z</dc:date>
    <item>
      <title>Dynamic line chart background colours</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-line-chart-background-colours/m-p/749886#M534548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a line chart of historic data, volume plotted against 'Historic Week Start Date'. I want my line colour to change based on historic Fiscal Year. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have currently achieved this by hard coding in the following in the Background Colour section of my expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(HistoricalFiscalYear='FY11',rgb(70,137,164),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY12',rgb(171,167,17),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY13',rgb(141,25,8),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY14',rgb(236,129,0),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(HistoricalFiscalYear='FY15',rgb(114,85,37))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This achieves the intended result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75930_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, to account for the possibility of the data being loaded in for more / different fiscal years, I would like to make this expression dynamic. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another field, 'HistoricalFYRow' which is a row count, which could potentially be used in the expression (as was finding it difficult to do max / min on the fiscal year field (FY11, FY12...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suggestions of how to modify this formula, perhaps with a variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Mel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 14:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-line-chart-background-colours/m-p/749886#M534548</guid>
      <dc:creator />
      <dc:date>2015-01-22T14:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic line chart background colours</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-line-chart-background-colours/m-p/749887#M534549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try =color(FieldIndex('HistoricalFiscalYear',HistoricalFiscalYear)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or read this blog for other options: &lt;A _jive_internal="true" class="font-color-normal" href="https://community.qlik.com/blogs/qlikviewdesignblog/2012/12/04/colors-in-charts" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3d3d3d;"&gt;Colors in charts&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 14:50:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-line-chart-background-colours/m-p/749887#M534549</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-01-22T14:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic line chart background colours</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-line-chart-background-colours/m-p/749888#M534550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jan 2015 14:59:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-line-chart-background-colours/m-p/749888#M534550</guid>
      <dc:creator />
      <dc:date>2015-01-22T14:59:44Z</dc:date>
    </item>
  </channel>
</rss>

