<?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 sum, aggr and count in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-aggr-and-count/m-p/1437349#M431659</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;I have the below expression in my qlikview script and would like to know how we can reproduce the same in SQL so that i can validate the numbers at the backend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Aggr(Count( DISTINCT ProductCode), ProductCode, Division))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that AGGR function will work like a group by function in SQL. The output of &lt;SPAN style="font-size: 13.3333px;"&gt;Aggr(Count( DISTINCT ProductCode), ProductCode, Division) will be the count of productcode grouped by productcode and Division.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Viresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Nov 2017 12:25:26 GMT</pubDate>
    <dc:creator>vireshkolagimat</dc:creator>
    <dc:date>2017-11-08T12:25:26Z</dc:date>
    <item>
      <title>sum, aggr and count</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggr-and-count/m-p/1437349#M431659</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;I have the below expression in my qlikview script and would like to know how we can reproduce the same in SQL so that i can validate the numbers at the backend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(Aggr(Count( DISTINCT ProductCode), ProductCode, Division))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that AGGR function will work like a group by function in SQL. The output of &lt;SPAN style="font-size: 13.3333px;"&gt;Aggr(Count( DISTINCT ProductCode), ProductCode, Division) will be the count of productcode grouped by productcode and Division.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Viresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 12:25:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggr-and-count/m-p/1437349#M431659</guid>
      <dc:creator>vireshkolagimat</dc:creator>
      <dc:date>2017-11-08T12:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: sum, aggr and count</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggr-and-count/m-p/1437350#M431660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT SUM(COUNT) AS SUM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM (&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SELECT Count(DISTINCT ProductCode) AS COUNT,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductCode,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Division&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM ....&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By ProductCode, Division);&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 12:33:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggr-and-count/m-p/1437350#M431660</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-08T12:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: sum, aggr and count</title>
      <link>https://community.qlik.com/t5/QlikView/sum-aggr-and-count/m-p/1437351#M431661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This expression does not make sense. The Count() will be one for every ProductCode/Division combination (and the DISTINCT will do nothing since you are already distinct because of the Aggr() dimensions). You cannot do this expression directly in SQL as SQL will not allow you to aggregate and group by the same field. The nearest I could get was&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT Count(*)&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;Group By ProductCode, Division;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Nov 2017 12:38:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-aggr-and-count/m-p/1437351#M431661</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-11-08T12:38:07Z</dc:date>
    </item>
  </channel>
</rss>

