<?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: RangeSum in Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2152150#M93315</link>
    <description>&lt;P&gt;Hi Everyone,&amp;nbsp;&lt;BR /&gt;thank you very much for your time and answers... I have managed to get the cumulative sum by using the AsOfTable... But then i get wrong numbers, because of the Faktor field... By using the AsOfTable, i calculate the values * Faktor for each month... However, as you can see in the picture attached, the logic says, calculate Wert and multiply total by current Faktor:&lt;BR /&gt;01.2023: 30702,5 * 0,96 = 29474,4&lt;/P&gt;
&lt;P&gt;02.2023: (30702,5 + 35940) * 0,97 = 64463,23&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 16:11:17 GMT</pubDate>
    <dc:creator>americanetsMD</dc:creator>
    <dc:date>2023-12-12T16:11:17Z</dc:date>
    <item>
      <title>RangeSum in Script</title>
      <link>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144876#M93159</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;consider having the next Table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/121130i598319164D122067/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;As you can see in the image, i have managed to get the Cumulive Sum by using the RangeSum expression.&lt;/P&gt;
&lt;P&gt;Anyway, the problem is when i select a specific Period, for example 12.2023, i get 94326, but i need the cumulative amount, 157212. Is there maybe an option to save the cumulative sums in Script, in a separate column?&lt;/P&gt;
&lt;P&gt;Important Note: there are multiple clients, which can have same product.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone give me a hint please.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 14:45:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144876#M93159</guid>
      <dc:creator>americanetsMD</dc:creator>
      <dc:date>2023-12-06T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: RangeSum in Script</title>
      <link>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144887#M93160</link>
      <description>&lt;P&gt;You can pre-calculate running totals in script - there's plenty of examples on Community - but they will not respond to any filters made within the app, which is typically not desirable behavior. You may find it a better idea to calculate these measures while ignoring selections on the Period field, since you need to start from the earliest available period to get a correct running total.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 15:01:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144887#M93160</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2023-12-06T15:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: RangeSum in Script</title>
      <link>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144918#M93163</link>
      <description>&lt;P&gt;One approach might be to query if a period-selection exists and then branching into different expressions with something like this:&lt;/P&gt;
&lt;P&gt;if(len(getfieldselections(Period)), sum({&amp;lt; Period = {"&amp;lt;=$(=max(Period))"}&amp;gt;}, Value),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; rangesum(above(sum())))&lt;/P&gt;
&lt;P&gt;Of course with some more if-loops you may also react on multiple selected periods and/or other conditions but it could become quite ugly.&lt;/P&gt;
&lt;P&gt;Another method would be to wrap the accumulation with an aggr() by ignoring any period-selections within the inner aggregation which would ensure that all cells for the interrecord-functions are there and which makes this calculation unresponsive against the period-selections. Against it you may apply a boolean-check with something like: count(distinct Period) which just returned 0 or 1 and by disabling ZERO results within the properties the excluded periods wouldn't be displayed. But if there are various fields and/or conditions such an approach could be come complex.&lt;/P&gt;
&lt;P&gt;Other considerations may go if such a period-selections is really needed - and if for which purpose? And if there is really a sensible reason if it could be done with another (independent) period-field?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 15:42:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144918#M93163</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-12-06T15:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: RangeSum in Script</title>
      <link>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144936#M93164</link>
      <description>&lt;P&gt;You can add to your current expression something like this :&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;+ $(=Sum({&amp;lt;Periode={"&amp;lt;$(=Min(Periode))"}&amp;gt;}Wert*Factor))&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 16:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2144936#M93164</guid>
      <dc:creator>vincent_ardiet_</dc:creator>
      <dc:date>2023-12-06T16:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: RangeSum in Script</title>
      <link>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2152150#M93315</link>
      <description>&lt;P&gt;Hi Everyone,&amp;nbsp;&lt;BR /&gt;thank you very much for your time and answers... I have managed to get the cumulative sum by using the AsOfTable... But then i get wrong numbers, because of the Faktor field... By using the AsOfTable, i calculate the values * Faktor for each month... However, as you can see in the picture attached, the logic says, calculate Wert and multiply total by current Faktor:&lt;BR /&gt;01.2023: 30702,5 * 0,96 = 29474,4&lt;/P&gt;
&lt;P&gt;02.2023: (30702,5 + 35940) * 0,97 = 64463,23&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 16:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/RangeSum-in-Script/m-p/2152150#M93315</guid>
      <dc:creator>americanetsMD</dc:creator>
      <dc:date>2023-12-12T16:11:17Z</dc:date>
    </item>
  </channel>
</rss>

