<?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: Calculation of an Account Balance? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76822#M604458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand the use of Resident Tables.&amp;nbsp; What is troubling me are the [3] separate LOAD statements under your SPCOUNT: in the solution you have provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought that any LOAD statement had to be introduced under a corresponding new (Table:) name.&amp;nbsp; In your solution, this is not the case and I have not encountered this anywhere else.&amp;nbsp; Can you please explain how/why this is being done in my specific case?&amp;nbsp; Or, refer me to any reading that would cover such syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Apr 2018 13:49:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-04-23T13:49:03Z</dc:date>
    <item>
      <title>Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76819#M604455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acct, Balance, SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Lucy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Jack&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Bill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Edgar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1630, 100, Paul&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// In the preceding, I want only the Balance in the FIRST line of each Acct&lt;/P&gt;&lt;P&gt;// to be used in calculating a ClosingBal for each Acct.&amp;nbsp; I.E., for Acct 1212, the Balance is 100&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//The calculation I need is the (Acct Balance) - count(SalesPerson) = ClosingBal where ClosingBal&lt;/P&gt;&lt;P&gt;//is the starting Balance for the next row in the Acct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//The Report would look like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Acct&amp;nbsp; Balance&amp;nbsp; SalesPerson ClosingBal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1212&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; David&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 99&lt;/P&gt;&lt;P&gt;1212&amp;nbsp;&amp;nbsp;&amp;nbsp; 99&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mike&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 98&lt;/P&gt;&lt;P&gt;1212&amp;nbsp;&amp;nbsp;&amp;nbsp; 98&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lucy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 97&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1525&amp;nbsp;&amp;nbsp; 325&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jack&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 324&lt;/P&gt;&lt;P&gt;1525&amp;nbsp;&amp;nbsp; 324&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bill&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 323&lt;/P&gt;&lt;P&gt;1525&amp;nbsp;&amp;nbsp; 323&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Edgar&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 322&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1630&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Paul&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 99&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// I only have QlikView Personal so I cannot process a 3rd party .qvw solution.&amp;nbsp; Anybody kind&lt;/P&gt;&lt;P&gt;// enough to help me would have to print out the solution.&amp;nbsp; I have spent two days on this with&lt;/P&gt;&lt;P&gt;// all kinds of approaches but still not got it.&amp;nbsp;&amp;nbsp; Thanks&amp;nbsp; David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 00:04:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76819#M604455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-23T00:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76820#M604456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're wanting to achieve this in the load script, the following works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acct, Balance, SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Lucy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Jack&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Bill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Edgar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1630, 100, Paul&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;SPCount:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;if(Acct=Previous(Acct),BalancePrev - AcctCountRT - 1, Balance -1) as BalanceClose&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if (Acct=Previous(Acct), Balance - AcctCountRT ,Balance) as Balance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Acct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;Load&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Acct=Previous(Acct), 1 + previous(AcctCount),0) as AcctCountRT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if(isnull(Previous(Balance)),Balance,Previous(Balance)) as BalancePrev&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Balance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if (Acct=Previous(Acct),1,0) as AcctCount&lt;/P&gt;&lt;P&gt;Resident tmp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table tmp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 06:20:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76820#M604456</guid>
      <dc:creator>campbellr</dc:creator>
      <dc:date>2018-04-23T06:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76821#M604457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works perfectly.&amp;nbsp; I am now trying to digest how and why it works. I am a rookie at QV and have lots to learn.&amp;nbsp; You have been a great help Sir and you are obviously no rookie!&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 13:05:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76821#M604457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-23T13:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76822#M604458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand the use of Resident Tables.&amp;nbsp; What is troubling me are the [3] separate LOAD statements under your SPCOUNT: in the solution you have provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought that any LOAD statement had to be introduced under a corresponding new (Table:) name.&amp;nbsp; In your solution, this is not the case and I have not encountered this anywhere else.&amp;nbsp; Can you please explain how/why this is being done in my specific case?&amp;nbsp; Or, refer me to any reading that would cover such syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 13:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76822#M604458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-23T13:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76823#M604459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;The multiple loads are what Qlik folk refer to as "preceding loads". There is lots written about it so I won't go into the nitty gritty here. The short version is they work from the bottom up and allow you to build calculated fields at one level then refer to that field in the next level up.&lt;/P&gt;&lt;P&gt;To make the script a little more bullet proof it would probably be best to include an "order by" line in the resident load to sort the data by the acct field, as it is if you were to add a new line at the end that had the same acct as the first line it would treat it as a new acct.&lt;/P&gt;&lt;P&gt;What you were asking to do is simple in Excel world where there is intention to calculate values based on other rows of data. I've had trouble in the past with Qlik trying to produce a running total with multiple sort fields involved, it's possible but far more difficult than it should be. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad it does what you were after. If you can share a desired outcome I (or someone else) might be able to suggest another way to get there.&lt;/P&gt;&lt;P&gt;Ron&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 23:13:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76823#M604459</guid>
      <dc:creator>campbellr</dc:creator>
      <dc:date>2018-04-23T23:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76824#M604460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ron, when I added 2 more records to ACCT 1212 in the InLine sample, the report becomes incorrect.&amp;nbsp; Specifically, if you run the following, the balance forward on line 4 of the 1212 ACCT is not correct.&amp;nbsp; Can you please take a look.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Thanks David&lt;/P&gt;&lt;P&gt;tmp:&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; Acct, Balance, SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Lucy&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Henry&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Joshua&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Jack&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Bill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Edgar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1630, 100, Paul&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;SPCount:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Acct=Previous(Acct),BalancePrev - AcctCountRT - 1, Balance -1) as BalanceClose&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if (Acct=Previous(Acct), Balance - AcctCountRT ,Balance) as Balance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Acct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Acct=Previous(Acct), 1 + previous(AcctCount),0) as AcctCountRT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if(isnull(Previous(Balance)),Balance,Previous(Balance)) as BalancePrev&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Balance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if (Acct=Previous(Acct),1,0) as AcctCount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Resident tmp;&lt;/P&gt;&lt;P&gt;Drop table tmp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 23:39:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76824#M604460</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-23T23:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76825#M604461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;take 2, have tested this and it works for your data and includes a sorting to keep the entries with the same acct together.&lt;/P&gt;&lt;P&gt;So I've added in a row count to use in the calculation of how many salespeople exist in the list and use that to subtract from the balance.&lt;/P&gt;&lt;P&gt;The mapping load is to assign the row count of the first line for each account. I had tried this as a preceding load but the rowNo() function doesn't work with a preceding load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acct, Balance, SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Lucy&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Henry&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1212, 100, Joshua&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Jack&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Bill&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1525, 325, Edgar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1630, 100, Paul&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (tmp)&lt;/P&gt;&lt;P&gt;Load&amp;nbsp; &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,RowNo() as rowCount&lt;/P&gt;&lt;P&gt;Resident tmp&lt;/P&gt;&lt;P&gt;Order By Acct, SalesPerson;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapFirstRow:&lt;/P&gt;&lt;P&gt;Mapping &lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Acct,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rowCount&lt;/P&gt;&lt;P&gt;Resident tmp&lt;/P&gt;&lt;P&gt;Order By Acct, rowCount;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;SPCount:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (Acct=Previous(Acct),Balance - AcctSPNum,Balance) as Balance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if (Acct=Previous(Acct),Balance - AcctSPNum - 1,Balance-1) as BalanceClose&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Acct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesPerson;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;rowCount - AcctFirstRow as AcctSPNum&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,*;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,ApplyMap('MapFirstRow',Acct) as AcctFirstRow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,SalesPerson&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,if(isnull(Previous(Acct)),Acct,Previous(Acct)) as AcctPrevious&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Balance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,rowCount&lt;/P&gt;&lt;P&gt;Resident tmp&lt;/P&gt;&lt;P&gt;Order By Acct,rowCount;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table tmp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2018 06:07:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76825#M604461</guid>
      <dc:creator>campbellr</dc:creator>
      <dc:date>2018-04-24T06:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76826#M604462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning Ron:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously, I have a lot to learn.&amp;nbsp; I am very grateful for your efforts and must "study" carefully what you have done.&amp;nbsp; I am of course adapting this InLine model to a bigger problem where the concept applies over hundreds of thousands of records.&amp;nbsp; The syntax is always a struggle for me, compounded by how and why one approach makes more sense over another.&amp;nbsp; I have purchased most of the QV books and been through a lot of examples on YouTube and am slowly grasping the basics.&amp;nbsp; The 'balance forward' calculation type of problem and your solution to it gives me a lot to think about and digest.&amp;nbsp; So now, &lt;SPAN style="text-decoration: underline;"&gt;and I admit this&lt;/SPAN&gt;, I will adapt what you have supplied to my business problem without truly understanding all of its complete ramifications.&amp;nbsp; I may have to come back to you with a few questions specific to your solution when I get this thing underway.&amp;nbsp; Again, I am much obliged and think that this QV Community is one of the best things I have discovered.&amp;nbsp; Best regards David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2018 12:22:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76826#M604462</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-24T12:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76827#M604463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;I'm happy to explain in more depth any of the bits that are causing concern. The preceding loads and ApplyMap() functions are two things I have found very useful recently. ApplyMap has&amp;nbsp; a distinct advantage over joining two tables in that it does not introduce duplication. It works like a vlookup in Excel in that it returns the value associated with the first match between the map and the data. Also the mapping table is automatically dropped after the load is complete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 22:36:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76827#M604463</guid>
      <dc:creator>campbellr</dc:creator>
      <dc:date>2018-04-25T22:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76828#M604464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have applied your solution to the big picture and it works very well.&amp;nbsp; I do need to understand the how/why it works and will go through it as it is important to see the logic behind it all.&amp;nbsp; Right now, and with another post, I am having trouble with a Dynamic Calendar creation to view some of the data you have helped me with.&amp;nbsp; There is a great video on 'dynamic calendar' creation/usage at &lt;A href="https://www.youtube.com/watch?v=UTDyO68BYL8" title="https://www.youtube.com/watch?v=UTDyO68BYL8"&gt;Selecting Arbitrary Date Ranges - YouTube&lt;/A&gt;.&amp;nbsp; I have implemented this approach in a few other projects and it works well.&amp;nbsp; But on this recent project and after I had it working with one specific date field, I tried to switch it over to another date field.&amp;nbsp; Now, it doesn't work and the Selections Box does not pick up the date ranges I am specifying.&amp;nbsp; I think that the "Trigger" function is at the root of this problem.&amp;nbsp; But strangely enough, and to try to eliminate any conflicts, I did a dummy creation of another .qvw and had no luck with it either. I can call anywhere in North America if you think an actual conversation would be useful.&amp;nbsp; I am in Toronto and if you would not mind I can call you at your convenience.&amp;nbsp; I have Team Viewer on my PC if that would be of any help.&amp;nbsp; Regardless, I sure have appreciated your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 22:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76828#M604464</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-26T22:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76829#M604465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David&lt;/P&gt;&lt;P&gt;I found this when looking at calendars: &lt;A href="http://qlikviewcookbook.com/2015/05/better-calendar-scripts/" title="http://qlikviewcookbook.com/2015/05/better-calendar-scripts/"&gt;Better Calendar Scripts | Qlikview Cookbook&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It is an update on the calendar build that is standard with qlik training. makes sense.&lt;/P&gt;&lt;P&gt;It has the advantage of linking to a field name only and not a specific table to get the date range.&lt;/P&gt;&lt;P&gt;I make a field I call KeyDate and I have the calendar generate that as a field, as opposed to order date. I then load the date field in my data I want to filter on as KeyDate. I work with data with a number of date fields so choose just one.&lt;/P&gt;&lt;P&gt;Something to keep in mind is the calendar can only be used on one date field in an application. I have heard of ways around this but have not internalised how they work so for me one calendar belongs to one date field.&lt;/P&gt;&lt;P&gt;As for phone call / team viewer. I'm in Australia so time zone is a consideration. Team viewer is fine, also skype works too. My time zone is UTC +10. Can chat after hours my time. I'm happy to explain my workings.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 00:29:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76829#M604465</guid>
      <dc:creator>campbellr</dc:creator>
      <dc:date>2018-04-27T00:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76830#M604466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ron:&lt;/P&gt;&lt;P&gt;Did not know about the Calendar date restriction.&amp;nbsp; Found my problem though.&amp;nbsp; The source data on the problem date field was coming in as YYYY/MM/DD with the actual '/' contained in the data fields.&amp;nbsp; This is different from every other time that I have tried to use the technique shown in the video.&amp;nbsp; Was really frustrating that the selected 'from' and 'to' dates were not showing up in the Selections Box and I had thought that somehow with my inexperience with Triggers that I had somehow compromised the Document-Wide properties.&amp;nbsp; I would like to give the Team Viewer approach a try sometime and noting the Time Zone difference between us, it is incumbent for me to play the part of the "night owl".&amp;nbsp; Perhaps over a weekend sometime and when you clearly have nothing better to do!&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 13:17:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76830#M604466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-27T13:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76831#M604467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The joys of imported data that looks like a date but is actually just text. I have found, by a process of frequent frustration, that when importing data it is beneficial to use num() to force numbers to be numbers, text() to force text to stay as text and date() to make dates behave as dates. I've had many issues bringing in data that uses text fields as identifiers that often contain only numeric data. mostly not a problem but if the first character is a 0 it will be lost. However it seems not always does it get lost. Also recently found that this text field contained a number with a decimal point. it was interpreted as a number and a trailing 0 was lost. It's a pain having to specify each field data type but in the long run it saves a lot of time.&lt;/P&gt;&lt;P&gt;Happy to have a team viewer session, maybe a Friday evening for me to fit with a Friday morning for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Apr 2018 22:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76831#M604467</guid>
      <dc:creator>campbellr</dc:creator>
      <dc:date>2018-04-29T22:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of an Account Balance?</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76832#M604468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ron:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As valuable a resource as you are, I would like to try a TeamViewer connection with you next Friday, May 11th.&amp;nbsp; With your time at 9:30 PM, my time is 7:30 AM.&amp;nbsp; If you are available, I would like to give it a go.&amp;nbsp; My email address is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-email-small" href="mailto:david.balmer@sympatico.ca"&gt;david.balmer@sympatico.ca&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you could send me your email address, I can give you the TeamViewer ID and password.&amp;nbsp; We both have to have the same version of TeamViewer and I am currently on ver 13.&amp;nbsp; Perhaps we could just go over a few of the functions you provided in the 'balance-forward' solution.&amp;nbsp; I am not sure if Team Viewer allows us to speak over the connection but that would be something to try. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 20:26:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-an-Account-Balance/m-p/76832#M604468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-04T20:26:43Z</dc:date>
    </item>
  </channel>
</rss>

