<?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 sum in the load statement ... need some help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-in-the-load-statement-need-some-help/m-p/158845#M716309</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;In the LOAD statement I want to sum a RepeatCounter for each row looking back 6 months ...&lt;/P&gt;&lt;P&gt;For each row I need a sum of the following:&lt;/P&gt;&lt;P&gt;The Orderdate of the lookup records should be between Orderdate of the current row and Orderdate - 6 months&lt;BR /&gt;and the SerialNumber should also be the same ... (this indicates there is a repeated repair which we want to count)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already have some counters which I created, but this is the last counter needed ... and I can't find a good solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;RepeatRepair:&lt;BR /&gt;LOAD *,&lt;BR /&gt;IF (&lt;BR /&gt; (SerialNumber = previous (SerialNumber)) and&lt;BR /&gt; Serviceordernr &amp;lt;&amp;gt; previous(Serviceordernr) and&lt;BR /&gt; (addmonths(Orderdate, -6) &amp;lt; previous (Orderdate)),&lt;BR /&gt; 1,0) as RepeatCounter&lt;BR /&gt;;&lt;BR /&gt;LOAD&lt;BR /&gt;Serviceordernr,&lt;BR /&gt;SerialNumber,&lt;BR /&gt;Orderdate&lt;BR /&gt;RESIDENT RepeatRepairTemp&lt;BR /&gt;ORDER BY SerialNumber, Orderdate, Serviceordernr;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;JOIN&lt;BR /&gt;LOAD *,&lt;BR /&gt;IF (&lt;BR /&gt; (SerialNumber = previous (SerialNumber)) and&lt;BR /&gt; Serviceordernr &amp;lt;&amp;gt; previous(Serviceordernr) and&lt;BR /&gt; (addmonths(Orderdate , -6) &amp;lt; previous (Orderdate )),&lt;BR /&gt; 1,0) as RepeatCounter_repeatedSO&lt;BR /&gt;;&lt;BR /&gt;LOAD&lt;BR /&gt;Serviceordernr,&lt;BR /&gt;SerialNumber,&lt;BR /&gt;Orderdatum&lt;BR /&gt;RESIDENT RepeatRepairTemp&lt;BR /&gt;ORDER BY SerialNumber, Orderdate DESC, Serviceordernr DESC;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has suggestions on how to do this?? Is there a way of using a while loop??&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;Anita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Feb 2010 08:38:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-02-25T08:38:05Z</dc:date>
    <item>
      <title>sum in the load statement ... need some help</title>
      <link>https://community.qlik.com/t5/QlikView/sum-in-the-load-statement-need-some-help/m-p/158845#M716309</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;In the LOAD statement I want to sum a RepeatCounter for each row looking back 6 months ...&lt;/P&gt;&lt;P&gt;For each row I need a sum of the following:&lt;/P&gt;&lt;P&gt;The Orderdate of the lookup records should be between Orderdate of the current row and Orderdate - 6 months&lt;BR /&gt;and the SerialNumber should also be the same ... (this indicates there is a repeated repair which we want to count)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already have some counters which I created, but this is the last counter needed ... and I can't find a good solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;RepeatRepair:&lt;BR /&gt;LOAD *,&lt;BR /&gt;IF (&lt;BR /&gt; (SerialNumber = previous (SerialNumber)) and&lt;BR /&gt; Serviceordernr &amp;lt;&amp;gt; previous(Serviceordernr) and&lt;BR /&gt; (addmonths(Orderdate, -6) &amp;lt; previous (Orderdate)),&lt;BR /&gt; 1,0) as RepeatCounter&lt;BR /&gt;;&lt;BR /&gt;LOAD&lt;BR /&gt;Serviceordernr,&lt;BR /&gt;SerialNumber,&lt;BR /&gt;Orderdate&lt;BR /&gt;RESIDENT RepeatRepairTemp&lt;BR /&gt;ORDER BY SerialNumber, Orderdate, Serviceordernr;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;JOIN&lt;BR /&gt;LOAD *,&lt;BR /&gt;IF (&lt;BR /&gt; (SerialNumber = previous (SerialNumber)) and&lt;BR /&gt; Serviceordernr &amp;lt;&amp;gt; previous(Serviceordernr) and&lt;BR /&gt; (addmonths(Orderdate , -6) &amp;lt; previous (Orderdate )),&lt;BR /&gt; 1,0) as RepeatCounter_repeatedSO&lt;BR /&gt;;&lt;BR /&gt;LOAD&lt;BR /&gt;Serviceordernr,&lt;BR /&gt;SerialNumber,&lt;BR /&gt;Orderdatum&lt;BR /&gt;RESIDENT RepeatRepairTemp&lt;BR /&gt;ORDER BY SerialNumber, Orderdate DESC, Serviceordernr DESC;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has suggestions on how to do this?? Is there a way of using a while loop??&lt;/P&gt;&lt;P&gt;thx&lt;/P&gt;&lt;P&gt;Anita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2010 08:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-in-the-load-statement-need-some-help/m-p/158845#M716309</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-25T08:38:05Z</dc:date>
    </item>
  </channel>
</rss>

