<?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: aggr function performance problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808476#M1259584</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression you provided is incorrect and what it produces does not really need an aggr function. Please see my response to the previous poster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Feb 2015 21:44:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-02-28T21:44:38Z</dc:date>
    <item>
      <title>aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808471#M1259574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am hitting a strange performance issue with the app&amp;nbsp; I am working on and can not figure out why qlikview is performing the way it does. I have attached a sample application with a slice of my data. I have only included one expression in the sample app (the one with the &lt;EM&gt;issue). &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt; Things start to get slow when I reload about 3M rows. By the time I load more data (~5M rows), the app just hangs&amp;nbsp; on the chart&amp;nbsp; (displaying the progress bar on the chart)&amp;nbsp; while calculating the following expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count(aggr(memb_id,memb_id, service_date_id, service_type))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when the app freezes, windows stops responding too and the only way out is a hard reboot. I am running this on a laptop with 8gig of ram, however, when i upload the app to our server (96gig memory) same problem is observed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please take a look and maybe someone can spot an issue. Does the aggr function just rolls over for larger data sets? I have used the aggr function in other apps but never have seen this qlikview perform like this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808471#M1259574</guid>
      <dc:creator />
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808472#M1259576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change the expression as below&lt;/P&gt;&lt;P&gt;=SUM(Aggr(COUNT(memb_id),service_date_id,service_type))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 07:32:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808472#M1259576</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-28T07:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808473#M1259578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to change the order of Aggr and Count in your expression like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Aggr(Count(memb_id),service_date_id,service_type)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 09:01:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808473#M1259578</guid>
      <dc:creator>terezagr</dc:creator>
      <dc:date>2015-02-28T09:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808474#M1259580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;More about Aggr function and how to build it is here: &lt;A href="https://community.qlik.com/thread/38796"&gt;Aggr() function&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 09:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808474#M1259580</guid>
      <dc:creator>terezagr</dc:creator>
      <dc:date>2015-02-28T09:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808475#M1259582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But these two aggr function are not the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My expression:&lt;/P&gt;&lt;P&gt;count(aggr(memb_id,memb_id, service_date_id, service_type))&lt;/P&gt;&lt;P&gt;groups the records by the three dims and then provides a count of the groups (that's what I am looking for).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your expression:&lt;/P&gt;&lt;P&gt;SUM(Aggr(COUNT(memb_id),service_date_id,service_type)&lt;/P&gt;&lt;P&gt;counts number of rows in &lt;STRONG&gt;each&lt;/STRONG&gt; group and then gives me the sum of those counts, it essentially gives me the total number of rows in the data set which could be calculated simply by count(memb_id) as you can see in the attached qvw file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 21:43:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808475#M1259582</guid>
      <dc:creator />
      <dc:date>2015-02-28T21:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808476#M1259584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression you provided is incorrect and what it produces does not really need an aggr function. Please see my response to the previous poster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 21:44:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808476#M1259584</guid>
      <dc:creator />
      <dc:date>2015-02-28T21:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808477#M1259586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dont understand the logic behind keeping same field twoce in aggr function...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 22:39:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808477#M1259586</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-02-28T22:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808478#M1259587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure aggr() is the best approach to get this count. If you want the count of groupings, an expression that will probably run much faster is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count(DISTINCT memb_id &amp;amp; service_date_id &amp;amp; service_type)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com" rel="nofollow"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 23:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808478#M1259587</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-02-28T23:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808479#M1259588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my aggr expression is equivalent to this sql:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(*) from (select memb_id from sometable group by memb_id, service_date_id, service_type) as a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the inner select is the aggr function I have and the outer select is like the outer count around the aggr function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2015 23:33:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808479#M1259588</guid>
      <dc:creator />
      <dc:date>2015-02-28T23:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808480#M1259589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another way to write this in SQL would be:&lt;/P&gt;&lt;P&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;select count(DISTINCT memb_id || service_date_id ||&amp;nbsp; service_type) from sometable&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;&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;That is equivalent to the count(DISTINCT...) suggestion I made below. &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;&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;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2015 00:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808480#M1259589</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-03-01T00:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808481#M1259590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob for your help. Yes, this alternative expression runs much faster. My app does not freeze and it actually completes the calculation now which is a step in the right direction. However, depending on how much data is sliced by the user from the dim filters, it could take up to a minute or longer to complete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you, or any one else on this forum has other ideas I could build on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to reiterate again what the chart is suppose to do: &lt;/P&gt;&lt;P&gt;it is suppose to count and return number of groups in the data set expressed by the following expression:&lt;/P&gt;&lt;P&gt;Count(DISTINCT memb_id &amp;amp; service_date_id &amp;amp; service_type)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2015 23:47:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808481#M1259590</guid>
      <dc:creator />
      <dc:date>2015-03-01T23:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808482#M1259591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this in script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt; &lt;SPAN class="Bold"&gt;autonumberhash256(&lt;/SPAN&gt; memb_id &amp;amp; '_' &amp;amp;&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;service_date_id &amp;amp; '_' &amp;amp; service_type)&lt;/SPAN&gt;&amp;nbsp; AS Key&lt;/P&gt;&lt;P&gt; memb_id,&lt;/P&gt;&lt;P&gt; service_date_id,&lt;/P&gt;&lt;P&gt; year,&lt;/P&gt;&lt;P&gt;&amp;nbsp; month,&lt;/P&gt;&lt;P&gt;service_type,&lt;/P&gt;&lt;P&gt; amount, &lt;/P&gt;&lt;P&gt; cust_id,&lt;/P&gt;&lt;P&gt; location_type,&lt;/P&gt;&lt;P&gt; age,&lt;/P&gt;&lt;P&gt;cust_type&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;mydata.qvd &lt;/P&gt;&lt;P&gt;(qvd) where service_type&amp;nbsp; = '97001';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KeyCount:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;DISTINCT Key,&lt;/P&gt;&lt;P&gt;1 AS KeyCount&lt;/P&gt;&lt;P&gt;RESIDENT Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use Sum(KeyCount) as expression in your charts to calculate the key count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 02:00:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808482#M1259591</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-03-02T02:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: aggr function performance problem</title>
      <link>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808483#M1259592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very clever solution. The worst calculation now takes less than 5 seconds which is acceptable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 04:51:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggr-function-performance-problem/m-p/808483#M1259592</guid>
      <dc:creator />
      <dc:date>2015-03-02T04:51:33Z</dc:date>
    </item>
  </channel>
</rss>

