<?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: Determine Peak Account Balance in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339646#M412838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why can't you just use Sum(Amount) here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 May 2017 16:48:29 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-05-25T16:48:29Z</dc:date>
    <item>
      <title>Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339645#M412837</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'm looking to determine a peak balance per account when looking at data such as this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Account, TransDate, Amount&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 01/01/2016, 100&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 02/02/2016, 200&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 02/02/2016, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 03/03/2016, 300&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 04/04/2016, -200&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 05/05/2016, 50&lt;/P&gt;&lt;P&gt;&amp;nbsp; A, 06/06/2016, -40&lt;/P&gt;&lt;P&gt;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp; B,.....&lt;/P&gt;&lt;P&gt;&amp;nbsp; C,...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I've got transaction data for an account but I need to know what the peak running total ever got to for each account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The report will be along the lines of this:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Account&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Peak Balance&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;610&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;....&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;....&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;....&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't use 'as-at' tables because in addition to the fields shown there will be others in my data, such as transaction types, paid-in-by, and other things that the users may filter on.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please note that this is for an account summary, one line per account, and I'll not be including the transaction date, so I can't use 'BEFORE' to work my way back up the transactions within the account.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I can get the amount each date but what I'm after is, in effect...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAX (&lt;/P&gt;&lt;P&gt;&amp;nbsp; AGGR ( &lt;/P&gt;&lt;P&gt;&amp;nbsp; SUM ( Amount "where transdate &amp;lt;= current for AGGR" )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp; TransDate&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 16:45:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339645#M412837</guid>
      <dc:creator />
      <dc:date>2017-05-25T16:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339646#M412838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why can't you just use Sum(Amount) here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 16:48:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339646#M412838</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-25T16:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339647#M412839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My bad, try this may be&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Max(Aggr(RangeSum(Above(Sum(Amount), 0, RowNo())), Account, TransDate))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only thing to make sure is that your TransDate is sorted in ascending order from the script. or if you are using QV12 or above, you can use this approach&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/4673"&gt;The sortable Aggr function is finally here!&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 16:50:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339647#M412839</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-25T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339648#M412840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SUM(Amount) for account A would include all transactions - as I am not including the TransDate in the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm after is the peak balance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 16:56:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339648#M412840</guid>
      <dc:creator />
      <dc:date>2017-05-25T16:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339649#M412841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup, I figured it out... did you try my next suggestion?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 16:57:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339649#M412841</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-25T16:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339650#M412842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That next one looks promising.&amp;nbsp; I'll let you know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks Sunny.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 17:01:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339650#M412842</guid>
      <dc:creator />
      <dc:date>2017-05-25T17:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339651#M412843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds good &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 17:04:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339651#M412843</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-05-25T17:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339652#M412844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works for some, not others, but I think I'm teetering on the brink of success!&amp;nbsp; The example I gave misses out the fact that some values might be null and there are a lot more dimensions involved, multiple transactions per day, and other twiddly bits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I've nailed it and identified and squidged the anomalies, I'll update the thread with info on what can affect it working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help Sunny.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 07:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339652#M412844</guid>
      <dc:creator />
      <dc:date>2017-05-26T07:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Peak Account Balance</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339653#M412845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, Sunny's "&lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Max(Aggr(RangeSum(Above(Sum(Amount), 0, RowNo())), Account, TransDate))&lt;/STRONG&gt;" worked smashingly for the example that I provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just needed to ensure that I'd added all other dimensions that could vary within the account and that was it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 08:24:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-Peak-Account-Balance/m-p/1339653#M412845</guid>
      <dc:creator />
      <dc:date>2017-05-26T08:24:13Z</dc:date>
    </item>
  </channel>
</rss>

