<?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: Inventory Balances in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188751#M51892</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;I want to talk about Inventory Balance. How we can count curent Balance when we know Opening Balance and Periodic operation.&lt;/P&gt;&lt;P&gt;For example, we have curent debt on 01.01.2017:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/102-18779-1-169451/OpeningBalance.png"&gt;&lt;IMG alt="OpeningBalance.png" class="jive-image image-1" height="136" src="https://community.qlik.com/legacyfs/online/169466_OpeningBalance.png" width="404" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And you have operation list:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/102-18779-1-169456/OperationList.png"&gt;&lt;IMG alt="OperationList.png" class="jive-image image-2" height="511" src="https://community.qlik.com/legacyfs/online/169467_OperationList.png" width="202" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is &lt;SPAN class="emoticon_plus emoticon-inline"&gt;&lt;/SPAN&gt; and &lt;SPAN class="emoticon-inline emoticon_minus"&gt;&lt;/SPAN&gt; operation which show "in" and "out" payments in list of operation. We need to know Opening and Closing balance on every day.&lt;/P&gt;&lt;P&gt;Lets do it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmpOperation:&lt;/P&gt;&lt;P&gt;LOAD Date(Date) as Date, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\OperationList.xls]&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (tmpOperation)&lt;/P&gt;&lt;P&gt;LOAD ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OpeningBalance&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\Остатки задолженности.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Лист1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Operation: &lt;/P&gt;&lt;P&gt;LOAD Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Amount) as DayBalance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(OpeningBalance) as OpeningBalance&lt;/P&gt;&lt;P&gt;Resident tmpOperation&lt;/P&gt;&lt;P&gt;Group By ID, Date&lt;/P&gt;&lt;P&gt;Order By ID, Date&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table tmpOperation;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InventoryBalance:&lt;/P&gt;&lt;P&gt;LOAD Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(Previous(OpeningBalance)) or ID&amp;lt;&amp;gt;Previous(ID),OpeningBalance,Peek(ClosingBalance)) as OpeningBalance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayBalance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(Previous(OpeningBalance)) or ID&amp;lt;&amp;gt;Previous(ID),OpeningBalance+DayBalance,Peek(ClosingBalance)+DayBalance) as ClosingBalance&lt;/P&gt;&lt;P&gt;Resident Operation&lt;/P&gt;&lt;P&gt;Order By ID, Date&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Operation;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that we have table like this:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/102-18779-1-169459/InventoryBalance.png"&gt;&lt;IMG alt="InventoryBalance.png" class="jive-image image-3" height="413" src="https://community.qlik.com/legacyfs/online/169468_InventoryBalance.png" width="393" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jul 2017 14:07:22 GMT</pubDate>
    <dc:creator>andreasasenterp</dc:creator>
    <dc:date>2017-07-07T14:07:22Z</dc:date>
    <item>
      <title>Inventory Balances</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188745#M51886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Can someone help to advise how to compute inventory opening and closing balances across month and year.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Best Rdgs&lt;/P&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Sep 2010 06:49:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188745#M51886</guid>
      <dc:creator />
      <dc:date>2010-09-05T06:49:00Z</dc:date>
    </item>
    <item>
      <title>Inventory Balances</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188746#M51887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steven,&lt;/P&gt;&lt;P&gt;this is not a quick story to tell...&lt;/P&gt;&lt;P&gt;- For starters, I'd recommend combining Sales and Purchases into a single table "Transactions", only differentiating them by a flag or a Qualifier.&lt;/P&gt;&lt;P&gt;- You will also need current inventory balances, that you can use as the "starting point". With the current balance and all the historical transactions to go back in time and compute historical balances.&lt;/P&gt;&lt;P&gt;- It would be overly simplified if all your transactions were covered by Sales and Purchases... You should probably have some other types of Inventory transactions - like, for example, Cycle Counting adjustments, Quality reclassification, etc... Try to get hold of all possible transactions, or you'll never be able to tie to any other sources of information your end users have.&lt;/P&gt;&lt;P&gt;- Once you have the starting point and all the transactions, you need to :&lt;/P&gt;&lt;P&gt;1. Make a distinct list of all Items with their current balances&lt;/P&gt;&lt;P&gt;2. Create Monthly records for each Item - whether or not the item was purchased or sold in a month, you should have a row for eacj Item and each Month - within the desired time frame.&lt;/P&gt;&lt;P&gt;3. Create a monthly summary of all monthly transactions per Item/Month and left-join it into your table with Monthly Records.&lt;/P&gt;&lt;P&gt;4. Reload your Monthly records, sorted by Item and Month (descending), and calculated Monthly Opening Balance for each Item, using the previous balance and adding/subtracting the Monthly transactions. You'll need to use functions peek() and previous() to calculate it.&lt;/P&gt;&lt;P&gt;I know it sounds complex, but once you follow all the steps, it's not that bad. I think it's described in detail within the Developer II class. If you have the class materials, look it up. Contact your QlikView provider to get access to those materials or to go through the class. I think there is an on-line class coming up soon - look it up in the Training section on this website.&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Sep 2010 17:30:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188746#M51887</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-09-05T17:30:00Z</dc:date>
    </item>
    <item>
      <title>Inventory Balances</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188747#M51888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ckeck your application . But For Inventory balance I require more information.&lt;/P&gt;&lt;P&gt;like what is business scenarion to calculate inventory in your case.&lt;/P&gt;&lt;P&gt;Like Cumulative (Purchase-sales) = Closing balance or anything esle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sunil Jain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 12:00:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188747#M51888</guid>
      <dc:creator>suniljain</dc:creator>
      <dc:date>2010-09-06T12:00:55Z</dc:date>
    </item>
    <item>
      <title>Inventory Balances</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188748#M51889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunil Jain&lt;/P&gt;&lt;P&gt;I have purposely ignored the inventory adjustments, cycle count, order commitment etc because I just want to get the correct formula in computing the opening and ending balance. Just to keep it simple, ending = opening + purchase - sales.&lt;/P&gt;&lt;P&gt;Please ensure that the opening and ending is still correct when user select either day, month, year or any combination.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Best Rdgs&lt;/P&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 14:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188748#M51889</guid>
      <dc:creator />
      <dc:date>2010-09-06T14:35:48Z</dc:date>
    </item>
    <item>
      <title>Inventory Balances</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188749#M51890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg Troyansky&lt;/P&gt;&lt;P&gt;I ram happy to hear from you and really appreciate your kind effort and valuable time in writing such a detailed recommendations.&lt;/P&gt;&lt;P&gt;My intention is to get the correct formula in computing opening and closing balances and therefore ignore all other factors such as inventory adjustments, cycle count, spoliage/scrapped etc. Please advise is there a quicker way to get the correct formula.&lt;/P&gt;&lt;P&gt;Thank you again for your kind contribution and consideration.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Best Rdgs&lt;/P&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Sep 2010 14:47:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188749#M51890</guid>
      <dc:creator />
      <dc:date>2010-09-06T14:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Balances</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188750#M51891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/stevenlow" id="jive-235764820375482616104" style="font-size: 12px; color: #007fc0; font-weight: bold;"&gt;stevenlow&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Did you get a solution for your requirement. I have the same problem.&lt;/P&gt;&lt;P&gt;If Oleg, or anybody, Can you give us a short example, it could be nice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR EXAMPLE :&lt;/P&gt;&lt;P&gt;The case where a starting balance exist and an transactions table with sale and Purchase of products.&lt;/P&gt;&lt;P&gt;Product Table&lt;/P&gt;&lt;P&gt;---------------------&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 50%; border-width: 1px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;ProductId&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;ProductName&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;prod1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;prod4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;prod2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;prod3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STARTING STOCK&lt;/P&gt;&lt;P&gt;-------------------------------&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 50%; border-width: 1px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;ProductId &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;Qty&lt;BR /&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transactions&lt;/P&gt;&lt;P&gt;-------------------------&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 50%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;ProductId&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;TransactionType&lt;BR /&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;TransactionQty&lt;BR /&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;TransactionDate(DD/MM/YYYY)&lt;BR /&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;'Sale'&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;21/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;'Purchase'&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;21/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;'Sale'&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;21/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;'Purchase'&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;24/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;'Sale'&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;24/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;'Sale'&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;27/01/2011&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Taxaw&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ce message a été modifié par: taxaw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 17:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188750#M51891</guid>
      <dc:creator />
      <dc:date>2011-06-30T17:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inventory Balances</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188751#M51892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;I want to talk about Inventory Balance. How we can count curent Balance when we know Opening Balance and Periodic operation.&lt;/P&gt;&lt;P&gt;For example, we have curent debt on 01.01.2017:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/102-18779-1-169451/OpeningBalance.png"&gt;&lt;IMG alt="OpeningBalance.png" class="jive-image image-1" height="136" src="https://community.qlik.com/legacyfs/online/169466_OpeningBalance.png" width="404" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;And you have operation list:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/102-18779-1-169456/OperationList.png"&gt;&lt;IMG alt="OperationList.png" class="jive-image image-2" height="511" src="https://community.qlik.com/legacyfs/online/169467_OperationList.png" width="202" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is &lt;SPAN class="emoticon_plus emoticon-inline"&gt;&lt;/SPAN&gt; and &lt;SPAN class="emoticon-inline emoticon_minus"&gt;&lt;/SPAN&gt; operation which show "in" and "out" payments in list of operation. We need to know Opening and Closing balance on every day.&lt;/P&gt;&lt;P&gt;Lets do it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmpOperation:&lt;/P&gt;&lt;P&gt;LOAD Date(Date) as Date, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Amount&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\OperationList.xls]&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (tmpOperation)&lt;/P&gt;&lt;P&gt;LOAD ID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OpeningBalance&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\Остатки задолженности.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Лист1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Operation: &lt;/P&gt;&lt;P&gt;LOAD Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(Amount) as DayBalance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(OpeningBalance) as OpeningBalance&lt;/P&gt;&lt;P&gt;Resident tmpOperation&lt;/P&gt;&lt;P&gt;Group By ID, Date&lt;/P&gt;&lt;P&gt;Order By ID, Date&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table tmpOperation;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InventoryBalance:&lt;/P&gt;&lt;P&gt;LOAD Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(Previous(OpeningBalance)) or ID&amp;lt;&amp;gt;Previous(ID),OpeningBalance,Peek(ClosingBalance)) as OpeningBalance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayBalance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(IsNull(Previous(OpeningBalance)) or ID&amp;lt;&amp;gt;Previous(ID),OpeningBalance+DayBalance,Peek(ClosingBalance)+DayBalance) as ClosingBalance&lt;/P&gt;&lt;P&gt;Resident Operation&lt;/P&gt;&lt;P&gt;Order By ID, Date&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Operation;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that we have table like this:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/showImage/102-18779-1-169459/InventoryBalance.png"&gt;&lt;IMG alt="InventoryBalance.png" class="jive-image image-3" height="413" src="https://community.qlik.com/legacyfs/online/169468_InventoryBalance.png" width="393" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2017 14:07:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-Balances/m-p/188751#M51892</guid>
      <dc:creator>andreasasenterp</dc:creator>
      <dc:date>2017-07-07T14:07:22Z</dc:date>
    </item>
  </channel>
</rss>

