<?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: Add to Running Total when condition met? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912521#M316671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is it possible to post the sample qvw?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2015 16:25:53 GMT</pubDate>
    <dc:creator>settu_periasamy</dc:creator>
    <dc:date>2015-07-23T16:25:53Z</dc:date>
    <item>
      <title>Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912519#M316669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello --&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to generate a running total. The total will remove values from a static qty. When the running total dips below a certain level, it needs to add a predefined number to the running total to keep it from going negative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal of the running total is to stay above a certain #. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can this be achieved in Qlik?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="350" style="border: 1px solid rgb(0, 0, 0); width: 428px; height: 339px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Running Total&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Description&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;6000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Starting Qty&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Minimum reached - automatically add 1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1700&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1300&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Minimum reached - automatically add 1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1900&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1800&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 14:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912519#M316669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T14:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912520#M316670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's the expression I have so far that seems to work - but it does not have a proper starting value so that causes some problems with the overall calculation. How do I add a starting value? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Above(Column(1))&amp;lt;=5760, RangeSum((Above(Column(1))-Sum(QTY_REQ))+5760,0,NoOfRows(TOTAL)), RangeSum(Above(Column(1))-Sum(QTY_REQ),0,NoOfRows(TOTAL)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 16:19:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912520#M316670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T16:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912521#M316671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;is it possible to post the sample qvw?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 16:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912521#M316671</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-07-23T16:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912522#M316672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately the data is somewhat sensitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to create a sample data set and post. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 16:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912522#M316672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T16:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912523#M316673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is a sample of how the data looks in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I mentioned, my objective is to roll up the QTY_REQ over time, but also add to that rolling total so it stays ABOVE a predefined level. In the sample I am considering 500 to be the low point it should not go under.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 17:51:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912523#M316673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T17:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912524#M316674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have a potential path that seems to get me close to what I want, but something is still not right with it. Can anyone suggest a better way? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(isnull(Above(Column(1))),11520,(If(Above(Column(1))&amp;lt;=5760, RangeSum((Above(Column(1))-Sum(QTY_REQ)),0,NoOfRows(TOTAL))+5760, RangeSum(Above(Column(1))-Sum(QTY_REQ),0,NoOfRows(TOTAL)))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I start the calculation checking if the row above is empty. If it is, start at 11,520. Then it it just keeps going.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I can't quite sort the math out exactly on a calculator as to what I expect to get. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2015 19:37:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912524#M316674</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-23T19:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912525#M316675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you check your Above function, &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;The&lt;STRONG&gt; 0,NoOfRows(TOTAL) , &lt;/STRONG&gt;should come inner of the Above function right? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you give the expected output, it would help us to find the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;may be try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(isnull(Above(Sum(QTY_REQ))),11520,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If(Above(Sum(QTY_REQ))&amp;lt;=5760,&lt;/P&gt;&lt;P&gt;&amp;nbsp; RangeSum(Above(Sum(QTY_REQ),0,NoOfRows(TOTAL)),-Sum(QTY_REQ),5760),&lt;/P&gt;&lt;P&gt;&amp;nbsp; RangeSum(Above(Sum(QTY_REQ),0,NoOfRows(TOTAL)),-Sum(QTY_REQ))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 02:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912525#M316675</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-07-24T02:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912526#M316676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Settu -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my expectation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a static number in this case that is 11,520. I want the values from my data table to be subtracted in a rolling fashion from 11,520. When the running total reaches less than or equal to 5,760 - I want the running total to automatically add 5,760 back and then continue subtracting. If it reaches 5,760 again - do the same. The end result should be a graph that looks something like this (the image is just an example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="graph.PNG" class="jive-image image-1" height="186" src="https://community.qlik.com/legacyfs/online/94057_graph.PNG" style="width: 672px; height: 186.23px;" width="672" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 12:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912526#M316676</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-27T12:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912527#M316677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Hi Joe,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;can you provide the expected output based on your provided example?&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;in the below snapshot, just give the output in yellow color column. it would easy to achieve the solution.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/94062_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 12:56:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912527#M316677</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-07-27T12:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912528#M316678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's my expectation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/94059_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 13:06:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912528#M316678</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-27T13:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912529#M316679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you try the below attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 15:04:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912529#M316679</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-07-27T15:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912530#M316680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Settu --&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, this seems to be working as expected now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One other question that is somewhat related. Do you think it would be possible to use a time variable as well to determine when the qty should be added? For example, the data table reduces and adds the qty when it reaches below a value. But what if I only want to add that value if it was X # of days after the last time it reached that value.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/94140_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 19:21:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912530#M316680</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-27T19:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add to Running Total when condition met?</title>
      <link>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912531#M316681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try this...&lt;/P&gt;&lt;P&gt;Create a Variable, and use that variable in your expression like Mod(RowNo(),vPassedDays)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA for reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Jul 2015 05:31:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Add-to-Running-Total-when-condition-met/m-p/912531#M316681</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2015-07-28T05:31:39Z</dc:date>
    </item>
  </channel>
</rss>

