<?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 Aggregate Function Help! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506292#M189281</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;I am having a problem with aggregate function which I thought I knew how it works but now I am just confused.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scenario:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have a set of data that looks like the image below, what I am trying to do now is to have a chart that shows the sum(Amount) of the last month of each year, therefore, the desired result should should be:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2012 : 30&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2013 : 50&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have tried the expression below which I thought aggregate function should return me with the latest month of each year but it didn't give me the desired result but just empty cells &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Date={"$(=aggr(max(Date),Year))"}&amp;gt;} Amount)&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Data.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/49704_Data.JPG.jpg" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have attached the test application that contain the data for this scenario, appreciate if anyone can help. &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;Thank you.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Nov 2013 02:35:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-11-29T02:35:57Z</dc:date>
    <item>
      <title>Aggregate Function Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506292#M189281</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;I am having a problem with aggregate function which I thought I knew how it works but now I am just confused.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Scenario:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have a set of data that looks like the image below, what I am trying to do now is to have a chart that shows the sum(Amount) of the last month of each year, therefore, the desired result should should be:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2012 : 30&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2013 : 50&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have tried the expression below which I thought aggregate function should return me with the latest month of each year but it didn't give me the desired result but just empty cells &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Date={"$(=aggr(max(Date),Year))"}&amp;gt;} Amount)&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Data.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/49704_Data.JPG.jpg" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have attached the test application that contain the data for this scenario, appreciate if anyone can help. &lt;/STRONG&gt;&lt;STRONG style="font-size: 10pt; line-height: 1.5em;"&gt;Thank you.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards.&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 02:35:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506292#M189281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-29T02:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate Function Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506293#M189282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use:&lt;/P&gt;&lt;P&gt;=FirstSortedValue( AGGR(Sum(Amount),Date), -AGGR(Date,Date))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 05:26:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506293#M189282</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-11-29T05:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate Function Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506294#M189283</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;see below scipt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi see the below script,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tt:&lt;/P&gt;&lt;P&gt;LOAD year, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yearmonth, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; amount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;xyz.xls;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left join&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;year,&lt;/P&gt;&lt;P&gt;max(yearmonth) as maxdates&lt;/P&gt;&lt;P&gt;resident tt group by&amp;nbsp; year;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; load&lt;/P&gt;&lt;P&gt; year,&lt;/P&gt;&lt;P&gt; if(yearmonth= maxdates,'y','n') as flag,&lt;/P&gt;&lt;P&gt; amount&lt;/P&gt;&lt;P&gt; resident tt;&lt;/P&gt;&lt;P&gt; drop Table tt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now use&amp;nbsp;&amp;nbsp;&amp;nbsp; =sum({&amp;lt;flag={'y'}&amp;gt;}amount) in your chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 06:19:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506294#M189283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-29T06:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Aggregate Function Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506295#M189284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Create a variable&lt;/P&gt;&lt;P&gt;maxmnth=month(max(Date))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the expression wud be&lt;/P&gt;&lt;P&gt;sum(if(month(Date)=maxmnth,Amount))..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 06:26:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506295#M189284</guid>
      <dc:creator>sudeep_d</dc:creator>
      <dc:date>2013-11-29T06:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate Function Help!</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506296#M189285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Tresesco, it solved my problem! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2013 06:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-Function-Help/m-p/506296#M189285</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-29T06:31:50Z</dc:date>
    </item>
  </channel>
</rss>

