<?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 Aggr In Qlik in Archived Groups</title>
    <link>https://community.qlik.com/t5/Archived-Groups/Aggr-In-Qlik/m-p/1476683#M3398</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AGGR IN QLIKVIEW &lt;/P&gt;&lt;DIV class="post-header"&gt; &lt;/DIV&gt;&lt;DIV class="post-body entry-content"&gt;&lt;DIV dir="ltr" style="text-align: left;"&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;STRONG&gt;Aggr Statement can be said as a virtual table,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;with one expression groped with one or more dimension so that we can &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;get a grouped results on the basis &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;of that expression&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;There is a special function for advanced aggregations:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;aggr ([ distinct | nodistinct ] [{set_expression}]expression {, dimension}) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;In case in a chart we want to dispalay result according to Aggr Function&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Let us suppose we want to see the average sale as per the salesperson&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;and as comparison to the dimension Region Wise.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;In case we are using the simple QV expression we can get the Avg sale result as per&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;the given expression&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;(sum(sales)/count(Order)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So it will give the Avg sales as per the no of Orders,But not as per the dimension Country which is the required result.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So here comes the role of Aggr Function.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So while working with the aggr we have to implement the following steps&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;1&amp;gt;Use the above expression for calculating the Avg Sales&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ie-(sum(sales)/count(Order)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;2&amp;gt;Now we have to display the result as per the salesperson for the particular region.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So the output will be&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Aggr(sum(Sales)/ count(Order), Country, Salesperson)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;which will give the average sales as per Salesperson over the partcular region.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Now we have to calculate the max among the averag value calculated so far as per the country.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Let us take an example-&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;SalesPerson,Region,Average Order Value By Region&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North ,50&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North ,25&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North ,100&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,South ,125&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,South ,143&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;So in case we want to get the max result as per our virtul table that have been created using the Aggr function so far the Expression &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;will be something like this&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;MAX(Aggr(sum(Sales)/ count(Order),Country, Salesperson))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;and the Output as per the above result will be&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;SalesPerson&amp;nbsp; ,Region , MaxOrder&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North&amp;nbsp; ,100&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,South&amp;nbsp; ,143&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2025 14:48:52 GMT</pubDate>
    <dc:creator>kamalqlik</dc:creator>
    <dc:date>2025-07-23T14:48:52Z</dc:date>
    <item>
      <title>Aggr In Qlik</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Aggr-In-Qlik/m-p/1476683#M3398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;AGGR IN QLIKVIEW &lt;/P&gt;&lt;DIV class="post-header"&gt; &lt;/DIV&gt;&lt;DIV class="post-body entry-content"&gt;&lt;DIV dir="ltr" style="text-align: left;"&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;STRONG&gt;Aggr Statement can be said as a virtual table,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;with one expression groped with one or more dimension so that we can &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;get a grouped results on the basis &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;of that expression&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;There is a special function for advanced aggregations:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;aggr ([ distinct | nodistinct ] [{set_expression}]expression {, dimension}) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;In case in a chart we want to dispalay result according to Aggr Function&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Let us suppose we want to see the average sale as per the salesperson&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;and as comparison to the dimension Region Wise.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;In case we are using the simple QV expression we can get the Avg sale result as per&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;the given expression&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;(sum(sales)/count(Order)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So it will give the Avg sales as per the no of Orders,But not as per the dimension Country which is the required result.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So here comes the role of Aggr Function.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So while working with the aggr we have to implement the following steps&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;1&amp;gt;Use the above expression for calculating the Avg Sales&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ie-(sum(sales)/count(Order)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;2&amp;gt;Now we have to display the result as per the salesperson for the particular region.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;So the output will be&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Aggr(sum(Sales)/ count(Order), Country, Salesperson)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;which will give the average sales as per Salesperson over the partcular region.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Now we have to calculate the max among the averag value calculated so far as per the country.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Let us take an example-&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;SalesPerson,Region,Average Order Value By Region&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North ,50&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North ,25&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North ,100&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;E&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,South ,125&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,South ,143&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;So in case we want to get the max result as per our virtul table that have been created using the Aggr function so far the Expression &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;will be something like this&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;MAX(Aggr(sum(Sales)/ count(Order),Country, Salesperson))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;and the Output as per the above result will be&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;SalesPerson&amp;nbsp; ,Region , MaxOrder&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,North&amp;nbsp; ,100&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;G&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,South&amp;nbsp; ,143&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2025 14:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Aggr-In-Qlik/m-p/1476683#M3398</guid>
      <dc:creator>kamalqlik</dc:creator>
      <dc:date>2025-07-23T14:48:52Z</dc:date>
    </item>
  </channel>
</rss>

