<?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() in UI vs Group by in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590592#M1095153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi HIC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for the information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that Aggr function has no counterpart in script. However I am thinking to use Aggr function, instead of group by in script. So i will be using the below expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggr(SUM(InvoiceAmount),intInvoiceLineId,InvoiceType,InvoiceDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My &lt;STRONG&gt;old script&lt;/STRONG&gt; has the following code to create aggregation fields--&amp;gt;&lt;/P&gt;&lt;P&gt;InvoiceTemp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;InvoiceLineId,&lt;/P&gt;&lt;P&gt;InvoiceType,&lt;/P&gt;&lt;P&gt;((Amount / Discount) / (INTERVAL(DATE(InvoiceToDate) - (InvoiceFromDate),'D')+1)) AS InvoiceAmount,&lt;/P&gt;&lt;P&gt;Date(InvoiceFromDate + IterNo() -1 ) AS InvoiceDate&lt;/P&gt;&lt;P&gt;Resident Invoicetable&lt;/P&gt;&lt;P&gt;WHILE IterNo() &amp;lt;=&amp;nbsp; Date(InvoiceToDate) - InvoiceFromDate +1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoice:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;InvoiceLineId,&lt;/P&gt;&lt;P&gt;InvoiceType,&lt;/P&gt;&lt;P&gt;InvoiceDate,&lt;/P&gt;&lt;P&gt;SUM(InvoiceAmount) AS InvoiceAmount&lt;/P&gt;&lt;P&gt;RESIDENT&amp;nbsp; InvoiceTemp&lt;/P&gt;&lt;P&gt;GROUP BY&amp;nbsp; InvoiceDate,InvoiceType, InvoiceLineId;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP table InvoiceTemp;&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to confirm, will i get the same result with just using below expression, compare to using SUM(InvoiceAmount) in front end, along with above script in the dashboard??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggr(SUM(InvoiceAmount),intInvoiceLineId,InvoiceType,InvoiceDate)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 May 2014 08:41:53 GMT</pubDate>
    <dc:creator>surajap123</dc:creator>
    <dc:date>2014-05-06T08:41:53Z</dc:date>
    <item>
      <title>Aggr() in UI vs Group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590589#M1095150</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;&lt;/P&gt;&lt;P&gt;My aggregate table created in qlikivew script generates lot of rows,&amp;nbsp; as a result the data reload takes long time.&lt;/P&gt;&lt;P&gt;I am thinking to use Aggr function in the front end directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering is there any difference between-&lt;/P&gt;&lt;P&gt;--creating aggreated table in script and then using those generated fields in the UI objects.&lt;/P&gt;&lt;P&gt;--using Aggr(to aggregate the data across the necessary dimensions) in the UI directly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 16:11:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590589#M1095150</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2014-05-02T16:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() in UI vs Group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590590#M1095151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Script aggregations are not sensitive to selections.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 16:16:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590590#M1095151</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-05-02T16:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() in UI vs Group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590591#M1095152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want static aggregations, you should do it in the script. That will save CPU time since less needs to be calculated when the user clicks. However, as Stefan points out, you usually you want the aggregation to be dynamic; to be sensitive to selections; and then you should not pre-aggregate in the script. You should do it in the UI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, a script aggregation, e.g. a Group By with a Sum(...), corresponds to a chart where the dimension defines the grouping symbol and the expression contains an aggregation function, e.g. the Sum(...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Aggr() function is something different, and has in principle nothing to do with the aggregation itself. It is merely a function used to define the loop in a nested aggregation. It has no counterpart in the script. Hence, you should normally not use Aggr() to replace a script aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 16:38:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590591#M1095152</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2014-05-02T16:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() in UI vs Group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590592#M1095153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi HIC,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for the information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that Aggr function has no counterpart in script. However I am thinking to use Aggr function, instead of group by in script. So i will be using the below expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggr(SUM(InvoiceAmount),intInvoiceLineId,InvoiceType,InvoiceDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My &lt;STRONG&gt;old script&lt;/STRONG&gt; has the following code to create aggregation fields--&amp;gt;&lt;/P&gt;&lt;P&gt;InvoiceTemp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;InvoiceLineId,&lt;/P&gt;&lt;P&gt;InvoiceType,&lt;/P&gt;&lt;P&gt;((Amount / Discount) / (INTERVAL(DATE(InvoiceToDate) - (InvoiceFromDate),'D')+1)) AS InvoiceAmount,&lt;/P&gt;&lt;P&gt;Date(InvoiceFromDate + IterNo() -1 ) AS InvoiceDate&lt;/P&gt;&lt;P&gt;Resident Invoicetable&lt;/P&gt;&lt;P&gt;WHILE IterNo() &amp;lt;=&amp;nbsp; Date(InvoiceToDate) - InvoiceFromDate +1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoice:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;InvoiceLineId,&lt;/P&gt;&lt;P&gt;InvoiceType,&lt;/P&gt;&lt;P&gt;InvoiceDate,&lt;/P&gt;&lt;P&gt;SUM(InvoiceAmount) AS InvoiceAmount&lt;/P&gt;&lt;P&gt;RESIDENT&amp;nbsp; InvoiceTemp&lt;/P&gt;&lt;P&gt;GROUP BY&amp;nbsp; InvoiceDate,InvoiceType, InvoiceLineId;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP table InvoiceTemp;&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to confirm, will i get the same result with just using below expression, compare to using SUM(InvoiceAmount) in front end, along with above script in the dashboard??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggr(SUM(InvoiceAmount),intInvoiceLineId,InvoiceType,InvoiceDate)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 08:41:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590592#M1095153</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2014-05-06T08:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() in UI vs Group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590593#M1095154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The order of fields mentioned in group By and Aggr() matters. That means you have to realize that :&lt;/P&gt;&lt;P&gt;Aggr(SUM(InvoiceAmount),&lt;STRONG&gt;intInvoiceLineId,&lt;/STRONG&gt;InvoiceType&lt;STRONG&gt;,InvoiceDate&lt;/STRONG&gt;)&amp;nbsp; and&lt;/P&gt;&lt;P&gt;Aggr(SUM(InvoiceAmount),&lt;STRONG&gt;InvoiceDate&lt;/STRONG&gt;,InvoiceType,,&lt;STRONG&gt;intInvoiceLineId&lt;/STRONG&gt;)&amp;nbsp;&amp;nbsp; are NOT same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not only that, I would like to mention one more point: QV does this aggregation in the front end with use of dimensions in charts where you &lt;STRONG&gt;&lt;EM&gt;might not have to use this AGGR().&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 08:50:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590593#M1095154</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-05-06T08:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() in UI vs Group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590594#M1095155</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;for me it looks like your results should be the same, but ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;remamber, that in fact aggr() produces virtual table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, your expression:&lt;/P&gt;&lt;P&gt; Aggr(SUM(InvoiceAmount),intInvoiceLineId,InvoiceType,InvoiceDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will give you in result for each combination of your dimensions result of your expression.&lt;/P&gt;&lt;P&gt;If for example you will vave 2 different lineID and 2 type and 2 Date, you will get 6 rows from your aggr().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What will you see in your chart?&lt;/P&gt;&lt;P&gt;If you have for example no dimension in this chart, you will see nothing. And it is difference, because in this case your SUM(InvoiceAmount) give you result.&lt;/P&gt;&lt;P&gt;And i think, in this case even if you dont have groupby in your script, SUM(InvoiceAmount) will still give you the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But lets look like on another case. &lt;/P&gt;&lt;P&gt;Lets say, that you would like in your old application calculate: avg(InvoiceAmount)&lt;/P&gt;&lt;P&gt;In this case new expression:&lt;/P&gt;&lt;P&gt;avg(Aggr(SUM(InvoiceAmount),intInvoiceLineId,InvoiceType,InvoiceDate)) should give the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 08:57:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590594#M1095155</guid>
      <dc:creator />
      <dc:date>2014-05-06T08:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr() in UI vs Group by in script</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590595#M1095156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all..&lt;/P&gt;&lt;P&gt;I finally assume that i can use aggr() can be used to fulfill my requirement, without the need of group by in script..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 09:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-in-UI-vs-Group-by-in-script/m-p/590595#M1095156</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2014-05-06T09:16:14Z</dc:date>
    </item>
  </channel>
</rss>

