<?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 Problem with Running Total in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209911#M64713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="http://community.qlik.com/forums/p/44023/174947.aspx#174947"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A href="http://community.qlik.com/members/mabaeyens/default.aspx"&gt;Miguel Angel Baeyens&lt;/A&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;You are a Genius. It worked for me.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Many Thanks,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Taj.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Apr 2011 16:19:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-04-11T16:19:21Z</dc:date>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209907#M64709</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 have a table containing the sum of all payments made by a customer for each month. I want to add another column to the table to show the running total of all payments upto and including that month. Please can some one help?&lt;/P&gt;&lt;P&gt;As you can see, the current table below contains the 'Payment this month'. I just want to maintain a running total on a new column as per the second table. i.e. the current month should also have the payment made this month and all other previous months payments.&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taj.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/-4068_sourceID:4068" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 15:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209907#M64709</guid>
      <dc:creator />
      <dc:date>2011-04-11T15:20:27Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209908#M64710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In a chart, you can get that done using inter-record functions, according to your table, your new expression in a pivot or straight table should look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum(Payment) + above([Payment This Month])&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Where "Sum(Payment)" is the expression labelled "Payment this Month".&lt;/P&gt;&lt;P&gt;This will work as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;RangeSum(Above([Payment], 0, RowNo()))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 15:32:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209908#M64710</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-11T15:32:11Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209909#M64711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Migual Angel Baeyens,&lt;/P&gt;&lt;P&gt;Thanks for your reply. Please can you let me know how to do it as part of the script? I would like a new column in the table instead.&lt;/P&gt;&lt;P&gt;Many Thanks.&lt;/P&gt;&lt;P&gt;Taj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 15:36:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209909#M64711</guid>
      <dc:creator />
      <dc:date>2011-04-11T15:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209910#M64712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've replied a post with something very similar, but basically, using Previous() and Peek() functions in it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD IterNo() AS Month, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ceil(Rand() * 1000) AS Amount&lt;/P&gt;&lt;P&gt;AUTOGENERATE 1 WHILE IterNo() &amp;lt; 13; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TableStep2:&lt;/P&gt;&lt;P&gt;NOCONCATENATE LOAD *&lt;/P&gt;&lt;P&gt;RESIDENT Table&lt;/P&gt;&lt;P&gt;ORDER BY Month; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Table; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AcumTable:&lt;/P&gt;&lt;P&gt;LOAD *, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Month &amp;gt; Previous(Month), RangeSum(Amount, Peek('MonthAcum')), Amount) AS MonthAcum&lt;/P&gt;&lt;P&gt;RESIDENT TableStep2; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE TableStep2;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each record, if current record's Month field value is greater than previous record's, then add previous amount to current, and store it in a new field called "MonthAcum". If the record loaded is the first (so there is no previous) then the value is its own Amount.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 15:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209910#M64712</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-11T15:42:25Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209911#M64713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="http://community.qlik.com/forums/p/44023/174947.aspx#174947"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A href="http://community.qlik.com/members/mabaeyens/default.aspx"&gt;Miguel Angel Baeyens&lt;/A&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;You are a Genius. It worked for me.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Many Thanks,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Taj.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 16:19:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209911#M64713</guid>
      <dc:creator />
      <dc:date>2011-04-11T16:19:21Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209912#M64714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="http://community.qlik.com/forums/p/44023/174947.aspx#174947"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;A href="http://community.qlik.com/members/mabaeyens/default.aspx"&gt;Miguel Angel Baeyens&lt;/A&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am struggling with another problem now. I have different client accounts having amounts on the same month end and the logic is not able to differenciate between clients accounts and is mixing amounts between clients accounts. For example, if I have payments as per the below table, the logic adds the amounts across the clients and ends up with incorrect amount. Please can you let me know how I have differenciate clients while using the rangesum?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Taj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/1526.QlikViewQuery3.bmp"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/1526.QlikViewQuery3.bmp" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 17:41:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209912#M64714</guid>
      <dc:creator />
      <dc:date>2011-04-11T17:41:00Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209913#M64715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Taj,&lt;/P&gt;&lt;P&gt;You need to add another field in the ORDER BY clause as well as in the conditional, to look like the following (note that since these are rand data, they may return unexpected results)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Table:LOAD Chr(64 + Ceil(Rand() * 3)) AS CustNo, IterNo() AS Month, Ceil(Rand() * 1000) AS AmountAUTOGENERATE 3 WHILE IterNo() &amp;lt; 13; TableStep2:NOCONCATENATE LOAD *RESIDENT TableORDER BY CustNo, Month; DROP TABLE Table; AcumTable:LOAD *, If(CustNo = Previous(CustNo), If(Month &amp;gt; Previous(Month), RangeSum(Amount, Peek('MonthAcum')), Amount), Amount) AS MonthAcumRESIDENT TableStep2; DROP TABLE TableStep2;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 18:37:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209913#M64715</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-11T18:37:58Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209914#M64716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Miguel Angel Baeyens,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have another problem. This time I want to display the running totals for all months where payment was not made and I tried various load options(i.e. Outer, Inner etc.) and I am not getting the expected result. I have two tables as per the below and I am expecting the result as per the third table. Please can you let me know how I can achieve the result?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Taj&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/2210.QlikViewQuery4.bmp"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/2210.QlikViewQuery4.bmp" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Apr 2011 16:47:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209914#M64716</guid>
      <dc:creator />
      <dc:date>2011-04-12T16:47:14Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209915#M64717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Taj,&lt;/P&gt;&lt;P&gt;If your calendar and your model is working fine, I'd draw two charts with the following expressions in the first (only months greater than zero):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; PayMonthEnd = {"=Sum(PayAmount) &amp;gt; 0"} &amp;gt;} PayAmount)Sum({&amp;lt; PayMonthEnd = {"=Sum(PayAmount) &amp;gt; 0"} &amp;gt;} PayToDate)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum(PayToDate)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;In the second (all).&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2011 05:40:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209915#M64717</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-13T05:40:22Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209916#M64718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel Angel Baeyens,&lt;/P&gt;&lt;P&gt;Sorry for this late response. I have tried your suggestion and below is the result that I am getting. Please can you pass me a simple qvw file with charts for me to look at?&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taj. &lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/6278.QlikViewQuery5.bmp"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/6278.QlikViewQuery5.bmp" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 10:52:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209916#M64718</guid>
      <dc:creator />
      <dc:date>2011-04-21T10:52:33Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209917#M64719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Taj,&lt;/P&gt;&lt;P&gt;I don't have such QVW files. Maybe you can post some sample data or one file with only your chart and the expected behavior.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2011 18:34:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209917#M64719</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-04-22T18:34:12Z</dc:date>
    </item>
    <item>
      <title>Problem with Running Total</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209918#M64720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This solution is awesome!&lt;/P&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2011 11:58:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-Running-Total/m-p/209918#M64720</guid>
      <dc:creator />
      <dc:date>2011-08-04T11:58:19Z</dc:date>
    </item>
  </channel>
</rss>

