<?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 Inventory units for each week in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176705#M44597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark,&lt;/P&gt;&lt;P&gt;calculating the balances from the transactions is quite a chore... Here is the general idea:&lt;/P&gt;&lt;P&gt;1. Generate distinct lists of all Items and all Weeks in your range&lt;/P&gt;&lt;P&gt;2. Join between the two, to generate all possible permutations of Items and Weeks&lt;/P&gt;&lt;P&gt;3. Left Join into this table summary of transactions, aggregated by Item and Week.&lt;/P&gt;&lt;P&gt;4. Sorting the table by Item and Transaction Date, reload the table, calculating the running total :&lt;/P&gt;&lt;P&gt;if(previous(Item) = Item, peek(RunningTotal) + Transaction, Transaction) as RunningTotal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that you have ALL the transactions from each Item (from the beginning of the Item's life cycle), you should be able to calculate all weekly totals for all Items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Mar 2010 22:36:58 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2010-03-11T22:36:58Z</dc:date>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176703#M44595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all&lt;/P&gt;&lt;P&gt;I have a table with 30 million transactions( in/out from stock).&lt;/P&gt;&lt;P&gt;It is easy to calculate a rolling balance (takes 2-3 minutes), but what i need, is the inventorylevel week by week (end of week) until today.&lt;/P&gt;&lt;P&gt;Until now, I have tried to insert the dates for the week end using while and intervalmatch. But with 2,350,000 various combinations, there will be quite many rows.&lt;/P&gt;&lt;P&gt;My final thought was, maybe to do something with set analysis, but still no success.&lt;/P&gt;&lt;P&gt;Do any of you have any great ideas on , how to achieve the above requirement? I have attached an example of what the data looks like&lt;/P&gt;&lt;P&gt;Thank you in advance for any help.&lt;/P&gt;&lt;P&gt;/Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Mar 2010 15:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176703#M44595</guid>
      <dc:creator />
      <dc:date>2010-03-11T15:51:03Z</dc:date>
    </item>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176704#M44596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can probably use the WeekEnd and WeekStart statements for this. Will be easier on your system to add those to each record than to use IntervalMatch.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Mar 2010 18:30:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176704#M44596</guid>
      <dc:creator />
      <dc:date>2010-03-11T18:30:12Z</dc:date>
    </item>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176705#M44597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mark,&lt;/P&gt;&lt;P&gt;calculating the balances from the transactions is quite a chore... Here is the general idea:&lt;/P&gt;&lt;P&gt;1. Generate distinct lists of all Items and all Weeks in your range&lt;/P&gt;&lt;P&gt;2. Join between the two, to generate all possible permutations of Items and Weeks&lt;/P&gt;&lt;P&gt;3. Left Join into this table summary of transactions, aggregated by Item and Week.&lt;/P&gt;&lt;P&gt;4. Sorting the table by Item and Transaction Date, reload the table, calculating the running total :&lt;/P&gt;&lt;P&gt;if(previous(Item) = Item, peek(RunningTotal) + Transaction, Transaction) as RunningTotal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that you have ALL the transactions from each Item (from the beginning of the Item's life cycle), you should be able to calculate all weekly totals for all Items.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Mar 2010 22:36:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176705#M44597</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2010-03-11T22:36:58Z</dc:date>
    </item>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176706#M44598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg, thank you for your reply,&lt;/P&gt;&lt;P&gt;As i wrote in my post, its is easy to create the balance of the items (se my attach file in previous post).&lt;/P&gt;&lt;P&gt;What tricks me is the amount of data (30 mio rows, with 2,3 mio items). If you add that up it is quite many rows. What i basically need, is some thoughts on how to add the weeks without any transactions, in the best way.&lt;/P&gt;&lt;P&gt;I hav tried to do a while (time is an issue here), Intervalmatch (performance is an issue on this one).&lt;/P&gt;&lt;P&gt;/Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Mar 2010 05:35:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176706#M44598</guid>
      <dc:creator />
      <dc:date>2010-03-12T05:35:05Z</dc:date>
    </item>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176707#M44599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin ,&lt;/P&gt;&lt;P&gt;"------- some thoughts on how to add the weeks without any transactions, in the best way . ------"&lt;/P&gt;&lt;P&gt;Since your data size is huge, I think addition of Master Calender will work for you .&lt;/P&gt;&lt;P&gt;You can copy Master calender (refered code from some other links) from link : &lt;A href="http://community.qlik.com/forums/t/26678.aspx"&gt;http://community.qlik.com/forums/t/26678.aspx&lt;/A&gt; &amp;amp; modified to accomodate your dates .&lt;/P&gt;&lt;P&gt;Then you can link your Transaction Dates with Dates in Master Calender &amp;amp; pull report based on Weeks mentioned in Master calender .&lt;/P&gt;&lt;P&gt;I think that will solve your query .&lt;/P&gt;&lt;P&gt;Let me know in case of any dobuts.&lt;/P&gt;&lt;P&gt;Cheers ,&lt;/P&gt;&lt;P&gt;Bhushan N&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Mar 2010 06:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176707#M44599</guid>
      <dc:creator />
      <dc:date>2010-03-12T06:54:13Z</dc:date>
    </item>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176708#M44600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhusnan&lt;/P&gt;&lt;P&gt;It will not solve my issue. That script will just add a calendar.&lt;/P&gt;&lt;P&gt;Let take an example..the last transaction on a specific item is january 5, but we still have 10 units on stock, then i wont get the actual value as of today, when adding a calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Mar 2010 08:42:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176708#M44600</guid>
      <dc:creator />
      <dc:date>2010-03-12T08:42:07Z</dc:date>
    </item>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176709#M44601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin ,&lt;/P&gt;&lt;P&gt;Check this link : &lt;A href="http://community.qlik.com/forums/t/26601.aspx"&gt;http://community.qlik.com/forums/t/26601.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Bhushan N&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Mar 2010 09:57:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176709#M44601</guid>
      <dc:creator />
      <dc:date>2010-03-12T09:57:42Z</dc:date>
    </item>
    <item>
      <title>Inventory units for each week</title>
      <link>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176710#M44602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice technique with the application Martin, thansk for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Aug 2010 09:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Inventory-units-for-each-week/m-p/176710#M44602</guid>
      <dc:creator />
      <dc:date>2010-08-23T09:09:54Z</dc:date>
    </item>
  </channel>
</rss>

