<?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 Running total across dimensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319345#M117704</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have Loan of 1,000.&lt;/P&gt;&lt;P&gt;In 2012, Q1 the interest due is 100&lt;/P&gt;&lt;P&gt;In 2012, Q4 the interest due is 90&lt;/P&gt;&lt;P&gt;In 2013, Q1 the interest due is 80&lt;/P&gt;&lt;P&gt;In 2013, Q4 the interest due is 70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to see the balance at any given year or month that I can see at year or at month.&lt;/P&gt;&lt;P&gt;I've created a pivot table with Year &amp;amp; QTR as my horizontally alligned dimensions.&lt;/P&gt;&lt;P&gt;With the following Expression [Bal]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(YEAR=2012 and QTR=1,vLoanAmt - sum(INTEREST) // Start of Loan repayments&lt;/P&gt;&lt;P&gt;,Rangesum(-sum(INTEREST),before([Bal])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is the before() function works with the ColumnNo(), which resets to 1 for 2013 (I want it to be 3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG __jive_id="11672" alt="Untitled.jpg" class="jive-image-thumbnail jive-image" src="https://community.qlik.com/legacyfs/online/11672_Untitled.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Example attached)&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** EDIT&lt;/P&gt;&lt;P&gt;Found an expression which seems to do the trick:&lt;/P&gt;&lt;P&gt;if(YEAR=2012 and QTR=1,vLoanAmt - sum(INTEREST) // Start of Loan repayments&lt;BR /&gt;,vLoanAmt - Rangesum(before(Total&amp;nbsp; sum([INTEREST]),0,ColumnNo(TOTAL)))) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 Feb 2012 15:49:36 GMT</pubDate>
    <dc:creator>RedSky001</dc:creator>
    <dc:date>2012-02-26T15:49:36Z</dc:date>
    <item>
      <title>Running total across dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319345#M117704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have Loan of 1,000.&lt;/P&gt;&lt;P&gt;In 2012, Q1 the interest due is 100&lt;/P&gt;&lt;P&gt;In 2012, Q4 the interest due is 90&lt;/P&gt;&lt;P&gt;In 2013, Q1 the interest due is 80&lt;/P&gt;&lt;P&gt;In 2013, Q4 the interest due is 70&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to see the balance at any given year or month that I can see at year or at month.&lt;/P&gt;&lt;P&gt;I've created a pivot table with Year &amp;amp; QTR as my horizontally alligned dimensions.&lt;/P&gt;&lt;P&gt;With the following Expression [Bal]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(YEAR=2012 and QTR=1,vLoanAmt - sum(INTEREST) // Start of Loan repayments&lt;/P&gt;&lt;P&gt;,Rangesum(-sum(INTEREST),before([Bal])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is the before() function works with the ColumnNo(), which resets to 1 for 2013 (I want it to be 3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;IMG __jive_id="11672" alt="Untitled.jpg" class="jive-image-thumbnail jive-image" src="https://community.qlik.com/legacyfs/online/11672_Untitled.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Example attached)&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;** EDIT&lt;/P&gt;&lt;P&gt;Found an expression which seems to do the trick:&lt;/P&gt;&lt;P&gt;if(YEAR=2012 and QTR=1,vLoanAmt - sum(INTEREST) // Start of Loan repayments&lt;BR /&gt;,vLoanAmt - Rangesum(before(Total&amp;nbsp; sum([INTEREST]),0,ColumnNo(TOTAL)))) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Feb 2012 15:49:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319345#M117704</guid>
      <dc:creator>RedSky001</dc:creator>
      <dc:date>2012-02-26T15:49:36Z</dc:date>
    </item>
    <item>
      <title>Running total across dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319346#M117705</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;Use the below expression in your chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(YEAR=2012 and QTR=1,vLoanAmt - sum(INTEREST) // Start of Loan repayments&lt;/P&gt;&lt;P&gt;,Rangesum(-sum(INTEREST),before(TOTAL [Bal])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 05:53:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319346#M117705</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-27T05:53:45Z</dc:date>
    </item>
    <item>
      <title>Running total across dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319347#M117706</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;Use below expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(YEAR=2012 and QTR=1,vLoanAmt - sum(INTEREST) // Start of Loan repayments&lt;/P&gt;&lt;P&gt;,Rangesum(-sum(INTEREST),before(TOTAL [Bal])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 05:54:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319347#M117706</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-27T05:54:26Z</dc:date>
    </item>
    <item>
      <title>Running total across dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319348#M117707</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;Check this expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(YEAR=2012 and QTR=1,vLoanAmt - sum(INTEREST) // Start of Loan repayments&lt;/P&gt;&lt;P&gt;,Rangesum(-sum(INTEREST),before(TOTAL [Bal])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 05:55:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319348#M117707</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2012-02-27T05:55:40Z</dc:date>
    </item>
    <item>
      <title>Running total across dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319349#M117708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not quite right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vLoanAmt = 1000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;YEAR,QTR,INTEREST&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2012,1,100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2012,4,100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2013,1,100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2013,4,100&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following expression to accumulate the interest over the dimensions.&lt;/P&gt;&lt;P&gt;Rangesum(before(Total&amp;nbsp; sum([INTEREST]),0,ColumnNo(TOTAL)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works exect when I collapise the year 2013.&amp;nbsp; I'd expect to see 400 but see 0.&lt;/P&gt;&lt;P&gt;This is because there is nothing "Before" to summarise until I collapose 2012.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;IMG alt="1.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11686_1.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2.jpg" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11691_2.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2012 10:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-across-dimensions/m-p/319349#M117708</guid>
      <dc:creator>RedSky001</dc:creator>
      <dc:date>2012-02-27T10:35:14Z</dc:date>
    </item>
  </channel>
</rss>

