<?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 How to use aggr() function with max date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567145#M41368</link>
    <description>&lt;P&gt;I am new to Qlik Sense and have a simple problem that I couldn´t find any answers that fit my case:&lt;/P&gt;&lt;P&gt;I have a table like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date_Sales&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2019&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2019&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2019&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2019&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2019&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2019&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/03/2019&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/03/2019&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/03/2019&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to show in a KPI the sum of sales of the last date. In this case, last date is 31/03/2019 and the sum is 75.&lt;/P&gt;&lt;P&gt;The function that I came up was "=Max(aggr(sum([Value]),[Date_Sales.autoCalendar.YearMonth]))", but it´s, obviously incorrect, and only shows me the sum of the date 28/02/2019, which is 90 (max of the 3).&lt;/P&gt;&lt;P&gt;Any help for this? Sorry if it´s too simple. I started working on Qlik Sense this week and couldn´t find anything that helped me.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 18:34:11 GMT</pubDate>
    <dc:creator>Stevendf</dc:creator>
    <dc:date>2019-04-09T18:34:11Z</dc:date>
    <item>
      <title>How to use aggr() function with max date</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567145#M41368</link>
      <description>&lt;P&gt;I am new to Qlik Sense and have a simple problem that I couldn´t find any answers that fit my case:&lt;/P&gt;&lt;P&gt;I have a table like this:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date_Sales&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2019&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2019&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/01/2019&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2019&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2019&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;28/02/2019&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/03/2019&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/03/2019&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;31/03/2019&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to show in a KPI the sum of sales of the last date. In this case, last date is 31/03/2019 and the sum is 75.&lt;/P&gt;&lt;P&gt;The function that I came up was "=Max(aggr(sum([Value]),[Date_Sales.autoCalendar.YearMonth]))", but it´s, obviously incorrect, and only shows me the sum of the date 28/02/2019, which is 90 (max of the 3).&lt;/P&gt;&lt;P&gt;Any help for this? Sorry if it´s too simple. I started working on Qlik Sense this week and couldn´t find anything that helped me.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 18:34:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567145#M41368</guid>
      <dc:creator>Stevendf</dc:creator>
      <dc:date>2019-04-09T18:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use aggr() function with max date</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567169#M41372</link>
      <description>&lt;PRE&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="image.png" style="width: 180px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9814iB2FC4BB76564DBA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;RawData:
load  date#(Date_Sales, 'DD/MM/YYYY') as Date_Sales,
Value as Value 
inline [
Date_Sales,	Value
31/01/2019,10
31/01/2019,20
31/01/2019,30
28/02/2019,20
28/02/2019,30
28/02/2019,40
31/03/2019,15
31/03/2019,25
31/03/2019,35
];&lt;/PRE&gt;&lt;P&gt;With the script above you could use the following expression to get your 75.&lt;/P&gt;&lt;PRE&gt;=Sum({&amp;lt;Date_Sales = {"$(=Maxstring(Date_Sales))"}&amp;gt;}Value)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 19:01:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567169#M41372</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-04-09T19:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use aggr() function with max date</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567172#M41373</link>
      <description>try&lt;BR /&gt;Sum({&amp;lt;Date_Sales={'$(=Max(Date_Sales))'}&amp;gt;}Value)</description>
      <pubDate>Tue, 09 Apr 2019 19:01:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567172#M41373</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2019-04-09T19:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use aggr() function with max date</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567174#M41374</link>
      <description>&lt;P&gt;It worked perfectly. Thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 19:10:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-use-aggr-function-with-max-date/m-p/1567174#M41374</guid>
      <dc:creator>Stevendf</dc:creator>
      <dc:date>2019-04-09T19:10:56Z</dc:date>
    </item>
  </channel>
</rss>

