<?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 Best Practice for Inventory / Stock Level calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Best-Practice-for-Inventory-Stock-Level-calculation/m-p/659212#M240486</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 am trying to find the best practice for presenting Inventory / Stock levels by day based on underlying transaction data that basically shows product, date, quanitity, where quantity can be positive (stock coming in) or negative (stock going out).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have come up with three different solutions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Some kind of IF-statement combined with a Date Island, e.g. =IF(TransDate&amp;lt;=Max(DateIslandDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Looping balances in script e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR vDate = vStartDate to vEndDate&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;vDate as BalanceDate,&lt;/P&gt;&lt;P&gt;ProdId,&lt;/P&gt;&lt;P&gt;Sum(Quantity) as Balance&lt;/P&gt;&lt;P&gt;RESIDENT TransTable&lt;/P&gt;&lt;P&gt;WHERE TransDate&amp;lt;=vDate&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Peek-solution similar to what HIC proposes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With 10 000+ products all these solutions (except 1) take quite a long time to run and of course create a lot of rows if run over a couple of years 10 000 * 365 = 3.65 million per year. Alternative 3 gets quite complex if run over more dimensions than just Prod and Date. Alternative 2 is clean, but probably the slowest to run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else has come up with better solutions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Oct 2014 08:48:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-20T08:48:23Z</dc:date>
    <item>
      <title>Best Practice for Inventory / Stock Level calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Best-Practice-for-Inventory-Stock-Level-calculation/m-p/659212#M240486</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 am trying to find the best practice for presenting Inventory / Stock levels by day based on underlying transaction data that basically shows product, date, quanitity, where quantity can be positive (stock coming in) or negative (stock going out).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I have come up with three different solutions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Some kind of IF-statement combined with a Date Island, e.g. =IF(TransDate&amp;lt;=Max(DateIslandDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Looping balances in script e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR vDate = vStartDate to vEndDate&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;vDate as BalanceDate,&lt;/P&gt;&lt;P&gt;ProdId,&lt;/P&gt;&lt;P&gt;Sum(Quantity) as Balance&lt;/P&gt;&lt;P&gt;RESIDENT TransTable&lt;/P&gt;&lt;P&gt;WHERE TransDate&amp;lt;=vDate&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Peek-solution similar to what HIC proposes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With 10 000+ products all these solutions (except 1) take quite a long time to run and of course create a lot of rows if run over a couple of years 10 000 * 365 = 3.65 million per year. Alternative 3 gets quite complex if run over more dimensions than just Prod and Date. Alternative 2 is clean, but probably the slowest to run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else has come up with better solutions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Oct 2014 08:48:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Best-Practice-for-Inventory-Stock-Level-calculation/m-p/659212#M240486</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-20T08:48:23Z</dc:date>
    </item>
  </channel>
</rss>

