<?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: Using Aggr in Expression over the Dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Aggr-in-Expression-over-the-Dimension/m-p/1082748#M639139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course!!&amp;nbsp; That was it.&amp;nbsp; I could have sworn I tried that combination but it appears not.&amp;nbsp; The calculation is working properly now!&amp;nbsp; Cheers Gysbert!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Mar 2016 23:12:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-16T23:12:05Z</dc:date>
    <item>
      <title>Using Aggr in Expression over the Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-in-Expression-over-the-Dimension/m-p/1082746#M639137</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;I am having some difficulty in getting my aggr() function to work in one of my charts and am hoping this brilliant crew can assist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short, I am measuring the quantity of incidents by divisions.&amp;nbsp; I am using a scatter chart with two dimensions being =ValueList('A','B') and =Division.&amp;nbsp; I then have two expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(ValueList('A','B')='A', &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;max(aggr(Count(Incidents),Division))/2&lt;/STRONG&gt;&lt;/SPAN&gt;, count(Incidents))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(ValueList('A','B')='A', 0, sum(Cost))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of the aggr() function above is to find the Division with the most incidents, divide that number by 2 and then set the mid point of the chart at that location.&amp;nbsp; I am trying to create a starting 'mid-point' that should be the same for all Divisions showing on the chart.&amp;nbsp; This should also be a dynamic mid-point as filters are set (such at date range etc.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue appears to be that the aggr() function is doing the aggregation by dimension one Division at a time.&amp;nbsp; Since my chart dimension and the aggr () dimension are the same, my mid point is only aggregating with the one dimension available to it at a time.&amp;nbsp; The result is that every division has a different starting point that is set at half that divisions incident count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried using&amp;nbsp; &lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;max(aggr(Count(TOTAL Incidents),Division))/2&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt;"&gt; , however, that simply gets me the Total of all Divisions divided by 2 not the Total count of the largest division divided by 2.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The $Million dollar question is:&amp;nbsp; How do I get the aggr() function to look at ALL divisions inside the expression so that it can select the max total of the highest division?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 06:57:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-in-Expression-over-the-Dimension/m-p/1082746#M639137</guid>
      <dc:creator />
      <dc:date>2016-03-16T06:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr in Expression over the Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-in-Expression-over-the-Dimension/m-p/1082747#M639138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Maybe this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;if(ValueList('A','B')='A', &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;max(total aggr(Count(Incidents),Division))/2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;, count(Incidents))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 08:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-in-Expression-over-the-Dimension/m-p/1082747#M639138</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-16T08:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr in Expression over the Dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-in-Expression-over-the-Dimension/m-p/1082748#M639139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course!!&amp;nbsp; That was it.&amp;nbsp; I could have sworn I tried that combination but it appears not.&amp;nbsp; The calculation is working properly now!&amp;nbsp; Cheers Gysbert!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 23:12:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-in-Expression-over-the-Dimension/m-p/1082748#M639139</guid>
      <dc:creator />
      <dc:date>2016-03-16T23:12:05Z</dc:date>
    </item>
  </channel>
</rss>

