<?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: Running Total on specified fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435684#M700088</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, is it an option for you to do this running sum in the script? When you use functions previous() this will take the previous physical row. This mean that if the user sort the table by another field, this formula will not work for you. I suggest to load the table and sorted the way you want it, and then reload it and apply this formula.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Nov 2012 10:37:18 GMT</pubDate>
    <dc:creator>jvitantonio</dc:creator>
    <dc:date>2012-11-15T10:37:18Z</dc:date>
    <item>
      <title>Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435683#M700087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some assistance please. I am looking for the code in which i can achieve the following in my LOAD script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My table gets extracted to something simular to this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="298" style="width: 302px; border: 1px solid rgb(0, 0, 0); height: 258px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Customer&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Time&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;01/01/2012&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bulgion&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;05/01/2012&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;10/01/2012&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;15/01/2012&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bulgion&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20/01/2012&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Carfield&lt;/TD&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;25/01/2012&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bulgion&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;01/02/2012&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bulgion&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;05/02/2012&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Carfield&lt;/TD&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;10/02/2012&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;15/02/2012&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Carfield&lt;/TD&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20/02/2012&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;25/02/2012&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically the table is sorted via Date. And if needed i am sure it can be Customer, then date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the result i'm looking for is to have a running total of &lt;STRONG&gt;Time&lt;/STRONG&gt; against &lt;STRONG&gt;Customer and Product&lt;/STRONG&gt;, calculated &lt;STRONG&gt;per month&lt;/STRONG&gt;. This must in accordance to date. So my result should look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="298" style="width: 351px; border: 1px solid #000000; height: 292px;" width="349"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Customer&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Time&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Running Total&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;01/01/2012&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bulgion&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;05/01/2012&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;10/01/2012&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;2&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D&gt;Carfield&lt;/TD&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20/02/2012&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Angia&lt;/TD&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;25/02/2012&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to get nearly there by using this code:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IF(RecNo() = 1, Time,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF((Customer = Previous(Customer) AND Month = Previous(Month)), Time + Num(Previous(Peek(TimeRun))),Time)) AS TimeRun&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the problem is it has got to be sorted by costomer and date, but it also assumes it is always the same product. And that is where my error comes in.&lt;/P&gt;&lt;P&gt;It has to be sorted by date, so then the products would get mixed up and the string won't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLEASE HELP!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 10:17:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435683#M700087</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-15T10:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435684#M700088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, is it an option for you to do this running sum in the script? When you use functions previous() this will take the previous physical row. This mean that if the user sort the table by another field, this formula will not work for you. I suggest to load the table and sorted the way you want it, and then reload it and apply this formula.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 10:37:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435684#M700088</guid>
      <dc:creator>jvitantonio</dc:creator>
      <dc:date>2012-11-15T10:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435685#M700089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, this has to be run in the LOAD script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But sorting via Customer &amp;gt; Date, means that Product is not sorted. And it cannot be sorted by product. Some customers' final combination of time total accross all products, where others combine time per product. But it must be worked out by date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can upload the concept (without various products) if that can maybe help make more sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 10:43:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435685#M700089</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-15T10:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435686#M700090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes please, it would be better. And include in the qvw file the desire result according to your data. (you can use a simple text box to do this)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 10:45:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435686#M700090</guid>
      <dc:creator>jvitantonio</dc:creator>
      <dc:date>2012-11-15T10:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435687#M700091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See attached example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 10:53:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435687#M700091</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-15T10:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435688#M700092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see what i have been working on, and that it works without product taken into account. (Each customer only has 1 product)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically it works out when the customer runs out of SLA hours, then from that point start with billing hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i realised i need to take the Product into account also, so that is why i have this question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*I know it is not exactly what you asked for, but it should clear things up&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 10:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435688#M700092</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-15T10:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435689#M700093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is close to what i'm looking for. But there is 1 issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On 01/02/2012, the time must reset and not continue with the previous runing total. So Bulgion must be 4, and not 4+12(from Jan)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 11:05:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435689#M700093</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-15T11:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435690#M700094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, change Customer&amp;amp;Product in Customer&amp;amp;Product&amp;amp;TS_Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(RowNo()=1 or Customer&amp;amp;Product&amp;amp;TS_Month&amp;lt;&amp;gt;previous(Customer&amp;amp;Product&amp;amp;TS_Month),Time,Time+peek(RunningTotal)) as RunningTotal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 11:14:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435690#M700094</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-11-15T11:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435691#M700095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to update your test script to include months:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(RowNo()=1 or Customer&amp;amp;Product&amp;lt;&amp;gt;previous(Customer&amp;amp;Product) OR month(date(Date)) &amp;lt;&amp;gt; previous(month(date(Date))) ,Time,Time+peek(RunningTotal)) as RunningTotal&lt;/P&gt;&lt;P&gt;Resident Temp order by Customer,Product,Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this appears that this will do the trick....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;As for the last comment, all you're saying is basically pop product in between customer &amp;amp; month? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am in the proccess of pulling in live data so i will be able to give full confirmation when this is done&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2012 11:24:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435691#M700095</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-15T11:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total on specified fields</title>
      <link>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435692#M700096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works like a charm. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 08:56:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Running-Total-on-specified-fields/m-p/435692#M700096</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2012-11-19T08:56:31Z</dc:date>
    </item>
  </channel>
</rss>

