<?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: Concat aggregation sort not working for google chart map in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Concat-aggregation-sort-not-working-for-google-chart-map/m-p/364421#M135587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For those interested, the error made was missing the first colour in the &amp;amp;chco section. From the info on;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="loading" href="https://developers.google.com/chart/image/docs/gallery/new_map_charts#gcharts_shape_markers"&gt;https://developers.google.com/chart/image/docs/gallery/new_map_charts#gcharts_shape_markers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the very first colour needs to be the unselected land. Once i amended the code to;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;='&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://chart.apis.google.com/chart?&amp;amp;cht=map"&gt;http://chart.apis.google.com/chart?&amp;amp;cht=map&lt;/A&gt;&lt;SPAN&gt;' &amp;amp; '&amp;amp;chs=600x480' /* Chart size */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chld=' &amp;amp; concat(DISTINCT 'GB-'&amp;amp; State, '|', text(fieldIndex('State', State)-1))&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chdl=' &amp;amp; concat(DISTINCT County &amp;amp; ' Sales:' &amp;amp;&amp;nbsp; aggr(Sum(CountyValue),County), '|', text(fieldIndex('State', State)-1))&amp;nbsp; /* Legend */&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chco=B3BCC0|' &amp;amp; concat(if(aggr(Sum(CountyValue),State)&amp;gt;=200,'336600','FF0033'), '|', fieldIndex('State', State)-1)&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chtt=Nicks+Google+API+Map+Chart'&amp;nbsp; /* Chart Title */ //This works the title&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked as required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if i could only get the labels to work....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Aug 2012 13:41:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-09T13:41:18Z</dc:date>
    <item>
      <title>Concat aggregation sort not working for google chart map</title>
      <link>https://community.qlik.com/t5/QlikView/Concat-aggregation-sort-not-working-for-google-chart-map/m-p/364420#M135586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to make an amendment to the google chart API from Rob's cookbook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the code;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;='&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://chart.apis.google.com/chart?&amp;amp;cht=map"&gt;http://chart.apis.google.com/chart?&amp;amp;cht=map&lt;/A&gt;&lt;SPAN&gt;' &amp;amp; '&amp;amp;chs=600x480' /* Chart size */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chld=' &amp;amp; concat(DISTINCT 'GB-'&amp;amp; State, '|', text(fieldIndex('State', State)-1))&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chdl=' &amp;amp; concat(DISTINCT County &amp;amp; ' Sales:' &amp;amp;&amp;nbsp; aggr(Sum(CountyValue),County), '|', text(fieldIndex('State', State)-1))&amp;nbsp; /* Legend */&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chco=' &amp;amp; concat(if(aggr(Sum(CountyValue),State)&amp;gt;=200,'336600','FF0033'), '|', text(fieldIndex('State', State)-1))&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chtt=Nicks+Google+API+Map+Chart'&amp;nbsp; /* Chart Title */ //This works the title&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chm=' &amp;amp; concat(DISTINCT 'f' &amp;amp; County &amp;amp; ' Sales:' &amp;amp;&amp;nbsp; aggr(Sum(CountyValue),County) &amp;amp; ',000000,0,' &amp;amp; text(fieldIndex('State', State)-1) &amp;amp; ',15', '|', text(fieldIndex('State', State)-1))&amp;nbsp; /* Chart Markers */&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chma=10,110,10,10' /* Chart margins */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;within a chart which is displaying the map and counties correctly. If i check the url code output it shows;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://chart.apis.google.com/chart?&amp;amp;cht=map&amp;amp;chs=600x480"&gt;http://chart.apis.google.com/chart?&amp;amp;cht=map&amp;amp;chs=600x480&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;chld=GB-BDF|GB-CAM|GB-ESS|GB-HRT|GB-LUT|GB-NFK|GB-PTE|GB-SFK&amp;amp;chdl=Bedford Sales:43.85|Cambridgeshire Sales:717.52|Essex Sales:4352.59|Hertfordshire Sales:1199.21|Luton Sales:66.01|Norfolk Sales:0|Peterborough Sales:522|Suffolk Sales:143.4&lt;/P&gt;&lt;P&gt;&amp;amp;chco=336600|336600|336600|336600|FF0033|FF0033|FF0033|FF0033&lt;/P&gt;&lt;P&gt;&amp;amp;chtt=Nicks+Google+API+Map+Chart&lt;/P&gt;&lt;P&gt;&amp;amp;chm=fBedford Sales:43.85,000000,0,8,15|fCambridgeshire Sales:717.52,000000,0,27,15|fEssex Sales:4352.59,000000,0,62,15|fHertfordshire Sales:1199.21,000000,0,80,15|fLuton Sales:66.01,000000,0,103,15|fNorfolk Sales:0,000000,0,117,15|fPeterborough Sales:522,000000,0,134,15|fSuffolk Sales:143.4,000000,0,171,15&amp;amp;chma=10,110,10,10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's putting the field "State" and the field "County" in alphabetical order as expected for the "&amp;amp;chld" and "&amp;amp;chdl" sections, however, the "&amp;amp;chco=" section seems to be sorted incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chco=' &amp;amp; concat(if(aggr(Sum(CountyValue),State)&amp;gt;=200,'336600','FF0033'), '|', text(fieldIndex('State', State)-1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What it should be doing is summing the countyValue by state and if the value is greater than 200 then '336600' otherwise 'FF0033'. Judging by the output;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;County&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;aggr(Sum(Distinct CountyValue),State)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;concat(if(aggr(Sum(Distinct CountyValue),State)&amp;gt;=200,'336600','FF0033'), '|', text(fieldIndex('State', State)-1))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD bgcolor="#ff0000"&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;STRONG&gt;336600|336600|336600|336600|FF0033|FF0033|FF0033|FF0033 &lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Norfolk&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ff0000"&gt;&lt;SPAN style="color: #363636;"&gt;0&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;FF0033&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Bedford&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ff0000"&gt;&lt;SPAN style="color: #363636;"&gt;43.85&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;FF0033&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Luton&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ff0000"&gt;&lt;SPAN style="color: #363636;"&gt;66.01&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;FF0033&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Suffolk&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ff0000"&gt;&lt;SPAN style="color: #363636;"&gt;143.4&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;FF0033&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Peterborough&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#008000"&gt;&lt;SPAN style="color: #363636;"&gt;522&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;336600&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Cambridgeshire&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#008000"&gt;&lt;SPAN style="color: #363636;"&gt;717.52&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;336600&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Hertfordshire&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#008000"&gt;&lt;SPAN style="color: #363636;"&gt;1199.21&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;336600&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Essex&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#008000"&gt;&lt;SPAN style="color: #363636;"&gt;4352.59&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;336600&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it seems to be applying a different sort than the other aggr() functions are, even though the sort criteria is the same "text(fieldIndex('State', State)-1)".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to do this so that the sort is the same as the other sections?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 10:22:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concat-aggregation-sort-not-working-for-google-chart-map/m-p/364420#M135586</guid>
      <dc:creator />
      <dc:date>2012-07-24T10:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Concat aggregation sort not working for google chart map</title>
      <link>https://community.qlik.com/t5/QlikView/Concat-aggregation-sort-not-working-for-google-chart-map/m-p/364421#M135587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For those interested, the error made was missing the first colour in the &amp;amp;chco section. From the info on;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="loading" href="https://developers.google.com/chart/image/docs/gallery/new_map_charts#gcharts_shape_markers"&gt;https://developers.google.com/chart/image/docs/gallery/new_map_charts#gcharts_shape_markers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the very first colour needs to be the unselected land. Once i amended the code to;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;='&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://chart.apis.google.com/chart?&amp;amp;cht=map"&gt;http://chart.apis.google.com/chart?&amp;amp;cht=map&lt;/A&gt;&lt;SPAN&gt;' &amp;amp; '&amp;amp;chs=600x480' /* Chart size */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chld=' &amp;amp; concat(DISTINCT 'GB-'&amp;amp; State, '|', text(fieldIndex('State', State)-1))&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chdl=' &amp;amp; concat(DISTINCT County &amp;amp; ' Sales:' &amp;amp;&amp;nbsp; aggr(Sum(CountyValue),County), '|', text(fieldIndex('State', State)-1))&amp;nbsp; /* Legend */&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chco=B3BCC0|' &amp;amp; concat(if(aggr(Sum(CountyValue),State)&amp;gt;=200,'336600','FF0033'), '|', fieldIndex('State', State)-1)&lt;/P&gt;&lt;P&gt;&amp;amp; '&amp;amp;chtt=Nicks+Google+API+Map+Chart'&amp;nbsp; /* Chart Title */ //This works the title&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked as required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if i could only get the labels to work....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 13:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concat-aggregation-sort-not-working-for-google-chart-map/m-p/364421#M135587</guid>
      <dc:creator />
      <dc:date>2012-08-09T13:41:18Z</dc:date>
    </item>
  </channel>
</rss>

