<?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 with sum and max in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626883#M733576</link>
    <description>Hi Ariel&lt;BR /&gt;above expression, it passes only one max value to the set.&lt;BR /&gt;how can we pass multiple max values to this set SalesKey?&lt;BR /&gt;if it is possible this could be solved.</description>
    <pubDate>Mon, 23 Sep 2019 12:26:11 GMT</pubDate>
    <dc:creator>madushanfernand</dc:creator>
    <dc:date>2019-09-23T12:26:11Z</dc:date>
    <item>
      <title>Using Aggr with sum and max</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626799#M733569</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;Could you please someone help me on getting following output.?&lt;/P&gt;&lt;P&gt;i have a sales log file something looks like below. SalesKey is the log history key. Once a change in line has occurred or a new line is entered with corresponding changes and new SalesKey will be updated. For an example,&lt;/P&gt;&lt;P&gt;line no 2 is repeated again in line no 9 in records twice since its Ex-Fac-Date has changed. Like wise line no 4 and line no 7 ( High lighted ). but there CPO value is same. because of the change they have two SalesKey.&lt;/P&gt;&lt;P&gt;I want to get an output like shown in bottom table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;total sales = sum(SALES)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Criteria : when i select a month, need to get sum sales with having only max SalesKeys.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ex : line&amp;nbsp; no 2 value should be discarded in sum, instead line no 7 value should be taken in for sum.&lt;/P&gt;&lt;P&gt;total sum for following example should be 68311. herewith attached the&amp;nbsp; excel file and out put need as well.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/t5/image/serverpage/image-id/19822iFE4E8F3DB876EA76/image-size/medium?v=1.0&amp;amp;px=-1" border="0" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626799#M733569</guid>
      <dc:creator>madushanfernand</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr with sum and max</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626816#M733570</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Did you try to identify the last SaleKey in the Script?&lt;/P&gt;&lt;P&gt;Please see the attached file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ariel&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 10:14:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626816#M733570</guid>
      <dc:creator>ariel_klien</dc:creator>
      <dc:date>2019-09-23T10:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr with sum and max</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626837#M733572</link>
      <description>&lt;P&gt;hi Ariel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply. if i go into detail, could we get an out put like this.&lt;/P&gt;&lt;P&gt;1. if i select the month, total sales would be 68311.&lt;/P&gt;&lt;P&gt;2. if i select first week, total sales would be&amp;nbsp;28510 and for second week&amp;nbsp;68311&lt;/P&gt;&lt;P&gt;Your output is correct only if i select a month.&amp;nbsp;&lt;/P&gt;&lt;P&gt;cant we use something like, (mbut this gives me a wrong answer )&lt;/P&gt;&lt;P&gt;Aggr(sum(SALES),Aggr(max(SalesKey),Buyer,CPO))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;basically i want the records of sales values&amp;nbsp; which have the max SalesKey to be selected,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for any selected period of the time.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:26:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626837#M733572</guid>
      <dc:creator>madushanfernand</dc:creator>
      <dc:date>2019-09-23T11:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr with sum and max</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626849#M733574</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;sum({&amp;lt;SalesKey={$(= max(aggr(max(SalesKey),CPO)))} &amp;gt;}SALES)&lt;/P&gt;&lt;P&gt;Ariel&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:45:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626849#M733574</guid>
      <dc:creator>ariel_klien</dc:creator>
      <dc:date>2019-09-23T11:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr with sum and max</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626883#M733576</link>
      <description>Hi Ariel&lt;BR /&gt;above expression, it passes only one max value to the set.&lt;BR /&gt;how can we pass multiple max values to this set SalesKey?&lt;BR /&gt;if it is possible this could be solved.</description>
      <pubDate>Mon, 23 Sep 2019 12:26:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1626883#M733576</guid>
      <dc:creator>madushanfernand</dc:creator>
      <dc:date>2019-09-23T12:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr with sum and max</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1630265#M733578</link>
      <description>&lt;P&gt;Try the following link, it is to the main page of the Design Blog area, there are hundreds of how to posts in this area, use the search dialog to find things that may help you.&amp;nbsp; I was not exactly sure what you needed at this point, or I would have tried a few direct ones.&amp;nbsp; Generally it is best to start with a single term first and go from there.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 21:51:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-sum-and-max/m-p/1630265#M733578</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-10-01T21:51:28Z</dc:date>
    </item>
  </channel>
</rss>

