<?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 Cumulative Above RangeSum straight Table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701150#M53682</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Hope somebody could help me on that. I have this straight Table in Qlik Sense where you can find the Workind days marked as '1', and some items related to each day. What I need is to cummulate sum of items by Working days, so the sum of not Working days will be on the Working ones.&lt;/P&gt;&lt;P&gt;I did try without success:&lt;/P&gt;&lt;P&gt;Aggr(RangeSum(Above(Sum({&amp;lt;WorkingDay= {0}&amp;gt;} Items))), Date)&lt;/P&gt;&lt;P&gt;That's my Table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oscarvictory_0-1589292692553.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/33451i31C6B49C78EAB7C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oscarvictory_0-1589292692553.png" alt="oscarvictory_0-1589292692553.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That's the desirable outcom:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oscarvictory_1-1589292909976.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/33454i4E79D6DAA1E30644/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oscarvictory_1-1589292909976.png" alt="oscarvictory_1-1589292909976.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Many TKS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 14:17:31 GMT</pubDate>
    <dc:creator>oscarvictory</dc:creator>
    <dc:date>2020-05-12T14:17:31Z</dc:date>
    <item>
      <title>Cumulative Above RangeSum straight Table</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701150#M53682</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Hope somebody could help me on that. I have this straight Table in Qlik Sense where you can find the Workind days marked as '1', and some items related to each day. What I need is to cummulate sum of items by Working days, so the sum of not Working days will be on the Working ones.&lt;/P&gt;&lt;P&gt;I did try without success:&lt;/P&gt;&lt;P&gt;Aggr(RangeSum(Above(Sum({&amp;lt;WorkingDay= {0}&amp;gt;} Items))), Date)&lt;/P&gt;&lt;P&gt;That's my Table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oscarvictory_0-1589292692553.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/33451i31C6B49C78EAB7C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oscarvictory_0-1589292692553.png" alt="oscarvictory_0-1589292692553.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That's the desirable outcom:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="oscarvictory_1-1589292909976.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/33454i4E79D6DAA1E30644/image-size/medium?v=v2&amp;amp;px=400" role="button" title="oscarvictory_1-1589292909976.png" alt="oscarvictory_1-1589292909976.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Many TKS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 14:17:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701150#M53682</guid>
      <dc:creator>oscarvictory</dc:creator>
      <dc:date>2020-05-12T14:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Above RangeSum straight Table</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701176#M53686</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr(If([Working Day] = 1, RangeSum(Above(Sum(Items), 0, RowNo()))), SNo, (Date, (NUMERIC)))&lt;/LI-CODE&gt;&lt;P&gt;Where SNo is created in the script like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD * INLINE [
    Date, Working Day, Items
    01/01/2020, 0, 3
    02/01/2020, 1, 2
    03/01/2020, 1, 5
    04/01/2020, 0, 1
    05/01/2020, 0, 0
    06/01/2020, 0, 6
    07/01/2020, 1, 10
    08/01/2020, 1, 15
    09/01/2020, 1, 10
    10/01/2020, 1, 3
    11/01/2020, 0, 0
    12/01/2020, 0, 5
    13/01/2020, 1, 7
];

FinalTable:
LOAD *,
	 If(Previous([Working Day]) = 1, RangeSum(Peek('SNo'), 1), Alt(Peek('SNo'), 1)) as SNo
Resident Table
Order By Date;

DROP Table Table;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 May 2020 15:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701176#M53686</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-05-12T15:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Above RangeSum straight Table</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701451#M53714</link>
      <description>&lt;P&gt;Hi Sunny, it worked like a charm!!&lt;/P&gt;&lt;P&gt;If you please, I would like a few words about the logical of your solution. I prefer to understand rather than just copy &amp;amp; paste.&lt;/P&gt;&lt;P&gt;RGDS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 09:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701451#M53714</guid>
      <dc:creator>oscarvictory</dc:creator>
      <dc:date>2020-05-13T09:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Above RangeSum straight Table</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701546#M53720</link>
      <description>&lt;P&gt;So, the first step was to create a field which increment if the previous day is a working day or else stays the same from previous day (will go over why we need this later). But to do this, I used this code in the script&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(Previous([Working Day]) = 1, RangeSum(Peek('SNo'), 1), Alt(Peek('SNo'), 1)) as SNo&lt;/LI-CODE&gt;&lt;P&gt;The reason to create this field is that we are looking for a way to know the accumulation areas&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 263px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/33535iA2FB31E4662D20B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, as I get my areas, I can use SNo as my first dimension to use with the RangeSum(Above()) function. The RangeSum(Above()) function, when used without TOTAL, will restart accumulating after the value of second last dimension changes (in this case we only have 2 dimension, so SNo is the second last dimension)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr(If([Working Day] = 1, RangeSum(Above(Sum(Items), 0, RowNo()))), SNo, (Date, (NUMERIC)))&lt;/LI-CODE&gt;&lt;P&gt;Note: You will get a different result if you swap the order of dimensions&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Aggr(If([Working Day] = 1, RangeSum(Above(Sum(Items), 0, RowNo()))), (Date, (NUMERIC)), SNo)&lt;/LI-CODE&gt;&lt;P&gt;So, it is important to know that the order of dimension matters when you use Above() function. The order of dimension will dictate how your virtual chart is sorted and when does it need to restart the accumulation.&lt;/P&gt;&lt;P&gt;I hope this makes sense? Let me know if you need more help on this&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Sunny&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 12:48:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701546#M53720</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-05-13T12:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Above RangeSum straight Table</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701556#M53723</link>
      <description>&lt;P&gt;That was totally helpful!!&lt;/P&gt;&lt;P&gt;Very grateful from my side.&lt;/P&gt;&lt;P&gt;RGDS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 13:17:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-Above-RangeSum-straight-Table/m-p/1701556#M53723</guid>
      <dc:creator>oscarvictory</dc:creator>
      <dc:date>2020-05-13T13:17:35Z</dc:date>
    </item>
  </channel>
</rss>

