<?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: Calculate data from previous rows in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-data-from-previous-rows-in-script/m-p/996553#M339024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the only way is to make Looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I don't know how to make it in right way. Please help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Nov 2015 15:08:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-11-01T15:08:52Z</dc:date>
    <item>
      <title>Calculate data from previous rows in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-data-from-previous-rows-in-script/m-p/996552#M339023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to everyone!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a db table like:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="32.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/103553_32.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Yellow cells is have to be calculated.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;ToBuy = Ordered - Remain&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Remain = Remain (in previous month) - Ordered (in previous month) + ToBuy (in previous month)&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;So, the result should be like:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="31.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/103549_31.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Please, help to make it in load script or give please a hint to find the solution. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. I tried to make it in expression, but I couldn't do it in pivot table where I put in columns "Month-Year". &lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2015 06:35:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-data-from-previous-rows-in-script/m-p/996552#M339023</guid>
      <dc:creator />
      <dc:date>2015-10-30T06:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate data from previous rows in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-data-from-previous-rows-in-script/m-p/996553#M339024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the only way is to make Looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I don't know how to make it in right way. Please help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Nov 2015 15:08:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-data-from-previous-rows-in-script/m-p/996553#M339024</guid>
      <dc:creator />
      <dc:date>2015-11-01T15:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate data from previous rows in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-data-from-previous-rows-in-script/m-p/996554#M339025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use previous() or peek() to catch the values from the previous records - a very good explanation could you find here: &lt;A href="https://community.qlik.com/docs/DOC-9314"&gt;Peek() or Previous() ?&lt;/A&gt; and in your case, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;previous(Remain) - previous(Ordered) + previous(ToBuy)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Nov 2015 19:28:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-data-from-previous-rows-in-script/m-p/996554#M339025</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-11-01T19:28:42Z</dc:date>
    </item>
  </channel>
</rss>

