<?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 pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932196#M967535</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain the importance of nodistinct here in more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mayank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 May 2018 08:45:50 GMT</pubDate>
    <dc:creator>mayankraoka</dc:creator>
    <dc:date>2018-05-26T08:45:50Z</dc:date>
    <item>
      <title>Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932189#M967528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a pivot table with sales vs city and product. I want to add a new expressio wich shows sales by country.&lt;/P&gt;&lt;P&gt;My hierrachial leves are: country -&amp;gt; city.&lt;/P&gt;&lt;P&gt;I add this expression &lt;/P&gt;&lt;P&gt;aggr(sum(sales), country)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the pivot table I have the sum of sales by country only for the first city of the group (the rest with -), , I want to show total by country for all cities&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I do??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 09:03:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932189#M967528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-24T09:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932190#M967529</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;aggr(NODISTINCT sum(sales), country)&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;or&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;Sum(total &amp;lt;country&amp;gt; sales)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 09:09:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932190#M967529</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2015-09-24T09:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932191#M967530</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;just use sum() before your expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;sum(aggr(sum(sales), country))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 09:09:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932191#M967530</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2015-09-24T09:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932192#M967531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = Sum( total &amp;lt;country&amp;gt; sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 09:13:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932192#M967531</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-09-24T09:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932193#M967532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you might be aware, AGGR works as a Group by function and its expected behavior is to give results for the 1st row only. If you want to override it, have a "NODISTINCT" clause to it.. thats it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sreeni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 09:15:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932193#M967532</guid>
      <dc:creator>SreeniJD</dc:creator>
      <dc:date>2015-09-24T09:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932194#M967533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;go through this link&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3857"&gt;QlikView Technical Brief - AGGR.docx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will get information how to use aggr() in pivot table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 09:57:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932194#M967533</guid>
      <dc:creator>tripatirao</dc:creator>
      <dc:date>2015-09-24T09:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932195#M967534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a side note, if your aggr is calculating over integer fields on large data sets you will find performance is much higher, I have in data sets in the hundreds of millions and into the billions, found they can be much more efficient if i use integer representations of the field.&amp;nbsp; For instance if Region is West, maybe adding a field used just for this where N, W, S and East are 1, 2, 3, 4 kind of thing .. display West but use the integer field in the AGGR, this is more noticeable when the dimension in question has many values.&amp;nbsp;&amp;nbsp; I have not tested using a dual() to assign an underlying integer to see if it has the same affect. ...&amp;nbsp;&amp;nbsp; just my 2 cents &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2017 03:14:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932195#M967534</guid>
      <dc:creator />
      <dc:date>2017-05-04T03:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932196#M967535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain the importance of nodistinct here in more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mayank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 May 2018 08:45:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932196#M967535</guid>
      <dc:creator>mayankraoka</dc:creator>
      <dc:date>2018-05-26T08:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using aggr in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932197#M967536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you have a table that looks like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * inline [&lt;/P&gt;&lt;P&gt;YearMonth, Department, Sales&lt;/P&gt;&lt;P&gt;2018-jan, Toronto, 1000&lt;/P&gt;&lt;P&gt;2018-jan, New York, 1200&lt;/P&gt;&lt;P&gt;2018-jan, L.A., 1300&lt;/P&gt;&lt;P&gt;2018-feb, Toronto, 1100&lt;/P&gt;&lt;P&gt;2018-feb, New York, 2000&lt;/P&gt;&lt;P&gt;2018-feb, L.A., 700&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you want to calculate what percentage of the total sales a department has contributed in a given month. So you want to calculate sum(Sales) / sum of total sales per month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you write Sum(Aggr(Sum(Sales),YearMonth)) as an expression in your chart, then the result will be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YearMonth,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Department,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum of total sales per month&lt;/P&gt;&lt;P&gt;2018-jan,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toronto,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3500&lt;/P&gt;&lt;P&gt;2018-jan,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New York,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1200,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&lt;/P&gt;&lt;P&gt;2018-jan,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L.A.,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1300,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&lt;/P&gt;&lt;P&gt;2018-feb,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toronto,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1100,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3800&lt;/P&gt;&lt;P&gt;2018-feb,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New York,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&lt;/P&gt;&lt;P&gt;2018-deg,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L.A.,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 700,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because the AGGR function is DISTINCT by default. It will only return one value for each value of YearMonth. In order for you to get a value for each value in YearMonth, you need to use the qualifier NODISTINCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you write sum(Aggr(NODISTINCT sum(sales),YearMonth)) then the result will be:&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;YearMonth,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Department,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sales,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum of total sales per month&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2018-jan,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toronto,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3500&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2018-jan,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New York,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1200,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3500&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2018-jan,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L.A.,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1300,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3500&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2018-feb,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Toronto,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1100,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3800&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2018-feb,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New York,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3800&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2018-deg,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; L.A.,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 700,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3800&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;You can also get this result by simply writing sum(total &amp;lt;YearMonth&amp;gt; Sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2018 08:42:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-aggr-in-pivot-table/m-p/932197#M967536</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2018-07-02T08:42:17Z</dc:date>
    </item>
  </channel>
</rss>

