<?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 Running total with flexible start in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Running-total-with-flexible-start/m-p/189982#M52653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I need to calculate a type of running total which restarts at certain conditions. As an example, think of a regulary reccuring questionnary where you want to follow up each respondents historic answers. In the data example below the three first column are loaded from source and I need to calculate the last. The logic behind it is that as it should count how many reccuring years a specifc question has failed.&lt;/P&gt;&lt;P&gt;Question, Year, Failed, FailCount&lt;BR /&gt; 1, 2009, 1, 2&lt;BR /&gt; 1, 2008, 1, 1&lt;BR /&gt; 1, 2007, 0, 0&lt;BR /&gt; 1, 2006, 1, 1&lt;BR /&gt; 2, 2009, 0, 0&lt;BR /&gt; 2, 2008, 1, 3&lt;BR /&gt; 2, 2007, 1, 2&lt;BR /&gt; 2, 2006, 1, 1&lt;/P&gt;&lt;P&gt;It's an easy thing to solve with a loop and a shadow variable, but I can't get QlikView to loop over a previously loaded table. I've tried to use the function previous() in the load but without success. If it's possible to solve the problem directly in chart it's also ok.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;/Martin Höglund&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Sep 2009 19:10:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-09-17T19:10:03Z</dc:date>
    <item>
      <title>Running total with flexible start</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-with-flexible-start/m-p/189982#M52653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I need to calculate a type of running total which restarts at certain conditions. As an example, think of a regulary reccuring questionnary where you want to follow up each respondents historic answers. In the data example below the three first column are loaded from source and I need to calculate the last. The logic behind it is that as it should count how many reccuring years a specifc question has failed.&lt;/P&gt;&lt;P&gt;Question, Year, Failed, FailCount&lt;BR /&gt; 1, 2009, 1, 2&lt;BR /&gt; 1, 2008, 1, 1&lt;BR /&gt; 1, 2007, 0, 0&lt;BR /&gt; 1, 2006, 1, 1&lt;BR /&gt; 2, 2009, 0, 0&lt;BR /&gt; 2, 2008, 1, 3&lt;BR /&gt; 2, 2007, 1, 2&lt;BR /&gt; 2, 2006, 1, 1&lt;/P&gt;&lt;P&gt;It's an easy thing to solve with a loop and a shadow variable, but I can't get QlikView to loop over a previously loaded table. I've tried to use the function previous() in the load but without success. If it's possible to solve the problem directly in chart it's also ok.&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;/Martin Höglund&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2009 19:10:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-with-flexible-start/m-p/189982#M52653</guid>
      <dc:creator />
      <dc:date>2009-09-17T19:10:03Z</dc:date>
    </item>
    <item>
      <title>Running total with flexible start</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-with-flexible-start/m-p/189983#M52654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;TempData:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Question, Year, Failed&lt;BR /&gt;1, 2009, 1&lt;BR /&gt;1, 2008, 1&lt;BR /&gt;1, 2007, 0&lt;BR /&gt;1, 2006, 1&lt;BR /&gt;2, 2009, 0&lt;BR /&gt;2, 2008, 1&lt;BR /&gt;2, 2007, 1&lt;BR /&gt;2, 2006, 1&lt;BR /&gt;];&lt;BR /&gt;Data:&lt;BR /&gt;Load&lt;BR /&gt; Question,&lt;BR /&gt; Year,&lt;BR /&gt; Failed,&lt;BR /&gt; If(Question = Previous(Question), Failed + Peek('FailedCount',-1,'Data'), Failed) As FailedCount&lt;BR /&gt;Resident&lt;BR /&gt; TempData&lt;BR /&gt;Order by Question, Year;&lt;BR /&gt;Drop Table TempData;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2009 19:58:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-with-flexible-start/m-p/189983#M52654</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2009-09-17T19:58:14Z</dc:date>
    </item>
    <item>
      <title>Running total with flexible start</title>
      <link>https://community.qlik.com/t5/QlikView/Running-total-with-flexible-start/m-p/189984#M52655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;It almost did it. A slightly change and it all works perfect!&lt;/P&gt;&lt;P&gt;If(Question = Previous(Question), if(Failed = 0, 0, Failed + Peek('FailedCount',-1,'Data')), Failed) As FailedCount&lt;/P&gt;&lt;P&gt;/Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Sep 2009 20:28:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-total-with-flexible-start/m-p/189984#M52655</guid>
      <dc:creator />
      <dc:date>2009-09-17T20:28:30Z</dc:date>
    </item>
  </channel>
</rss>

