<?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: Aggr on 2 max fields. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309942#M407286</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Max(Aggr(Sum({&amp;lt;[Last Payment] = {"$(=Max([Last Payment]))"}&amp;gt;}[Outstanding]),[Last Payment]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Correction done in expression - forgot to include " before $&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jun 2017 09:20:17 GMT</pubDate>
    <dc:creator>kamal_sanguri</dc:creator>
    <dc:date>2017-06-05T09:20:17Z</dc:date>
    <item>
      <title>Aggr on 2 max fields.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309941#M407285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been searching other AGGR questions but cannot 'understand' what the solution needs to be. I have data as below, where there are outstanding values for a customer. the 2 inv id's are 2083 and 2346. The outstanding values are carried forward from 2083 to 2346. I need to show only the most resent inv id with its outstanding value. &lt;STRONG&gt;(Inv 2346)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My closest expression is "sum(Aggr(max([Outstanding]), [Last Payment]))", but it returns 2 rows instead of only the last record. &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 770px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="19" width="110"&gt;Invoicing&lt;/TD&gt;&lt;TD width="110"&gt;Invoiced&lt;/TD&gt;&lt;TD width="110"&gt;Invoice ID&lt;/TD&gt;&lt;TD width="110"&gt;Last Payment&lt;/TD&gt;&lt;TD class="xl65" width="110"&gt;Date Creation&lt;/TD&gt;&lt;TD class="xl65" width="110"&gt;Date Due&lt;/TD&gt;&lt;TD class="xl66" width="110"&gt;Outstanding&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="19"&gt;Company A&lt;/TD&gt;&lt;TD&gt;Company C&lt;/TD&gt;&lt;TD align="right"&gt;2083&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;31/Dec/2015&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;23/Dec/2015&lt;/TD&gt;&lt;TD class="xl67"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200.00 &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl68" height="19"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Company A&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl68"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Company C&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;2346&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;11/Feb/2016&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl69"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;23/Feb/2016&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl70"&gt;&lt;STRONG style="text-decoration: underline;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200.00 &lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate a explanation about what I am doing wrong, so that I can understand how the aggr works. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 09:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309941#M407285</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2017-06-05T09:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr on 2 max fields.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309942#M407286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Max(Aggr(Sum({&amp;lt;[Last Payment] = {"$(=Max([Last Payment]))"}&amp;gt;}[Outstanding]),[Last Payment]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Correction done in expression - forgot to include " before $&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 09:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309942#M407286</guid>
      <dc:creator>kamal_sanguri</dc:creator>
      <dc:date>2017-06-05T09:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr on 2 max fields.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309943#M407287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you may want to replace [Last Payment] in above expression with [Invoice ID], If you want to take most recent invoice code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference attaching a QV doc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 09:22:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309943#M407287</guid>
      <dc:creator>kamal_sanguri</dc:creator>
      <dc:date>2017-06-05T09:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr on 2 max fields.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309944#M407288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kamal. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Your solution returns only the last record for the whole data set. Probably was not clear from my side. Sorry. I require the outstanding value for each 'Invoiced' company. The example only had Company C as a example but there are many more companies. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 10:02:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309944#M407288</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2017-06-05T10:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr on 2 max fields.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309945#M407289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pls refer this..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 11:28:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309945#M407289</guid>
      <dc:creator>kamal_sanguri</dc:creator>
      <dc:date>2017-06-05T11:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr on 2 max fields.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309946#M407290</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;Dimensions&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;STRONG&gt;Invoicing&lt;/STRONG&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;&lt;STRONG&gt;Invoiced&lt;/STRONG&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;&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;Expressions&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;STRONG&gt;FirstSortedValue([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Invoice ID], -[&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Last Payment])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Max([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Last Payment])&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Date Creation&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;], -[&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Last Payment])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&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;STRONG style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;FirstSortedValue([&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Date Due&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;], -[&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;Last Payment])&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 11:35:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309946#M407290</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-06-05T11:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr on 2 max fields.</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309947#M407291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;To answer your question of what's wrong in your Expression '&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum(Aggr(max([Outstanding]), [Last Payment]))'&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;Your Requirement is to find out the Outstanding amount for the latest payment , so latest payment =Max(Last Payment) is required in your expression rather than max(outstanding). in your expression you are finding out max of Outstanding for each last payment which will give two records.&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;you need a expression to find out the max last payment for every client and the equivalent outstanding amount.&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;simply use the below for your requirement,&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({&amp;lt;[Last Payment] = {"$(=Max([Last Payment]))"}&amp;gt;}[Outstanding])&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2017 11:59:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-on-2-max-fields/m-p/1309947#M407291</guid>
      <dc:creator>malini_qlikview</dc:creator>
      <dc:date>2017-06-05T11:59:28Z</dc:date>
    </item>
  </channel>
</rss>

