<?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 Chart expression - picking a value from a table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762936#M271256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, is there a way to query a table from within a chart expression? Please note that the table cannot be linked to the rest of the model (it's a data island)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to to that by means of a couple of variables (produced with &lt;EM&gt;concat&lt;/EM&gt;) and match and subfield function.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;TAB1:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_20 &amp;amp; FLG_COL_40 &amp;amp; FLG_COL_55 as [Color key],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_20 as [Color (ph. 20)], &lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_40 as [Color (ph. 40)], &lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_55 as [Color (ph. 55)], &lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_POS as [Aggregated color],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; rowno() as [Row number]&lt;/P&gt;
&lt;P&gt;FROM $(vQVDPath)\TAB_COLORS.qvd (qvd);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; chr(39) &amp;amp; concat([Color key],chr(39)&amp;amp;','&amp;amp;chr(39),[Row number]) &amp;amp; chr(39) as ColorKeyConcat,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; chr(39) &amp;amp; concat([Aggregated color],',',[Row number]) &amp;amp; chr(39) as AggregatedColorConcat&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;RESIDENT &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13.3333330154419px;"&gt;TAB1&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;LET vColorKeyConcat = fieldvalue('ColorKeyConcat',1);&lt;/P&gt;
&lt;P&gt;LET vAggregatedColorConcat = fieldvalue('AggregatedColorConcat',1);&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be put in a text object.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;=subfield($(vAggregatedColorConcat),',', match('ARR',$(vColorKeyConcat)))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a simpler way? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 18:15:43 GMT</pubDate>
    <dc:creator>googel84</dc:creator>
    <dc:date>2015-03-20T18:15:43Z</dc:date>
    <item>
      <title>Chart expression - picking a value from a table</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762936#M271256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, is there a way to query a table from within a chart expression? Please note that the table cannot be linked to the rest of the model (it's a data island)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to to that by means of a couple of variables (produced with &lt;EM&gt;concat&lt;/EM&gt;) and match and subfield function.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;TAB1:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_20 &amp;amp; FLG_COL_40 &amp;amp; FLG_COL_55 as [Color key],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_20 as [Color (ph. 20)], &lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_40 as [Color (ph. 40)], &lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_55 as [Color (ph. 55)], &lt;/P&gt;
&lt;P&gt;&amp;nbsp; FLG_COL_POS as [Aggregated color],&lt;/P&gt;
&lt;P&gt;&amp;nbsp; rowno() as [Row number]&lt;/P&gt;
&lt;P&gt;FROM $(vQVDPath)\TAB_COLORS.qvd (qvd);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; chr(39) &amp;amp; concat([Color key],chr(39)&amp;amp;','&amp;amp;chr(39),[Row number]) &amp;amp; chr(39) as ColorKeyConcat,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; chr(39) &amp;amp; concat([Aggregated color],',',[Row number]) &amp;amp; chr(39) as AggregatedColorConcat&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;RESIDENT &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13.3333330154419px;"&gt;TAB1&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;LET vColorKeyConcat = fieldvalue('ColorKeyConcat',1);&lt;/P&gt;
&lt;P&gt;LET vAggregatedColorConcat = fieldvalue('AggregatedColorConcat',1);&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be put in a text object.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;=subfield($(vAggregatedColorConcat),',', match('ARR',$(vColorKeyConcat)))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a simpler way? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 18:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762936#M271256</guid>
      <dc:creator>googel84</dc:creator>
      <dc:date>2015-03-20T18:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression - picking a value from a table</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762937#M271257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the values of Aggregated color and Color key are unique then the values should get the same field index value in their symbol tables. So m&lt;SPAN style="font-size: 13.3333330154419px;"&gt;aybe: fieldvalue('Aggregated color',fieldindex('Color key','ARR'))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 18:39:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762937#M271257</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-03-20T18:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression - picking a value from a table</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762938#M271258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, &lt;EM&gt;Aggregated color&lt;/EM&gt; does have repeated values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 09:44:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762938#M271258</guid>
      <dc:creator>googel84</dc:creator>
      <dc:date>2015-03-23T09:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression - picking a value from a table</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762939#M271259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the example value 'ARR' could be related to multiple colors? But &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;match('ARR',$(vColorKeyConcat)) will always return the first match. So, either that's not always a correct result, or you only need the first match anyway and can add a &lt;EM&gt;where not exists(&lt;/EM&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;FLG_COL_POS)&lt;/EM&gt; to your load statement so you only have unique combinations.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 10:14:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762939#M271259</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-03-23T10:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression - picking a value from a table</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762940#M271260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, "ARR" represents the combination of three colors (&lt;EM&gt;orange&lt;/EM&gt; - A - &lt;EM&gt;red&lt;/EM&gt; - R - and again &lt;EM&gt;red&lt;/EM&gt; - R) which rolls up to "R" in &lt;EM&gt;Aggregated color&lt;/EM&gt;; but, on the other hand, "R" may be the rolled up value for many other combinations of colors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution I suggested in the original post works fine, but there may be a function that does the job better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 10:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762940#M271260</guid>
      <dc:creator>googel84</dc:creator>
      <dc:date>2015-03-23T10:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Chart expression - picking a value from a table</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762941#M271261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, you lost me. Please post some sample data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 10:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-expression-picking-a-value-from-a-table/m-p/762941#M271261</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-03-23T10:39:21Z</dc:date>
    </item>
  </channel>
</rss>

