<?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 Limit the Range Sum in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074187#M88105</link>
    <description>&lt;P&gt;Hello&lt;BR /&gt;I'm working on an expression that calculates the accumulative variance&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ali_hijazi_0-1684828270709.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/107763iFD7F476F4191E323/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ali_hijazi_0-1684828270709.png" alt="ali_hijazi_0-1684828270709.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;the main expression gets values up to April 2023 (limited in set analysis)&lt;BR /&gt;then I used Range Sum to calculate the variance&amp;nbsp;&lt;BR /&gt;then I chose Accumulation in the modifier to calculate the accumulative variance&lt;BR /&gt;the numbers are correct but I want to display values up to 2023 04&lt;BR /&gt;&lt;BR /&gt;main Expression is :&lt;BR /&gt;Sum({&amp;lt;MonthDiff={0},Scenario={Actual},Date_Num={"&amp;lt;$(=Max({1&amp;lt;[Is Current Month]={1}&amp;gt;}[Date_Num]))"}&amp;gt;}Periodic)&lt;BR /&gt;&lt;BR /&gt;the expression that calculates the variance is :&lt;BR /&gt;fabs&lt;BR /&gt;(rangesum(&lt;BR /&gt;Sum( {&amp;lt;MonthDiff={0},Scenario={Actual},Date_Num={"&amp;lt;$(=Max({1&amp;lt;[Is Current Month]={1}&amp;gt;}[Date_Num])-1)"}&amp;gt;}Periodic )&lt;BR /&gt;,&lt;BR /&gt;-1*above( Sum( {&amp;lt;[Year Month]=, MonthDiff={0},Scenario={Actual},Date_Num={"&amp;lt;$(=Max({1&amp;lt;[Is Current Month]={1}&amp;gt;}[Date_Num])-1)"}&amp;gt;}Periodic ))*avg(1)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;kindly advise&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2023 07:54:19 GMT</pubDate>
    <dc:creator>ali_hijazi</dc:creator>
    <dc:date>2023-05-23T07:54:19Z</dc:date>
    <item>
      <title>Limit the Range Sum</title>
      <link>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074187#M88105</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;I'm working on an expression that calculates the accumulative variance&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ali_hijazi_0-1684828270709.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/107763iFD7F476F4191E323/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ali_hijazi_0-1684828270709.png" alt="ali_hijazi_0-1684828270709.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;the main expression gets values up to April 2023 (limited in set analysis)&lt;BR /&gt;then I used Range Sum to calculate the variance&amp;nbsp;&lt;BR /&gt;then I chose Accumulation in the modifier to calculate the accumulative variance&lt;BR /&gt;the numbers are correct but I want to display values up to 2023 04&lt;BR /&gt;&lt;BR /&gt;main Expression is :&lt;BR /&gt;Sum({&amp;lt;MonthDiff={0},Scenario={Actual},Date_Num={"&amp;lt;$(=Max({1&amp;lt;[Is Current Month]={1}&amp;gt;}[Date_Num]))"}&amp;gt;}Periodic)&lt;BR /&gt;&lt;BR /&gt;the expression that calculates the variance is :&lt;BR /&gt;fabs&lt;BR /&gt;(rangesum(&lt;BR /&gt;Sum( {&amp;lt;MonthDiff={0},Scenario={Actual},Date_Num={"&amp;lt;$(=Max({1&amp;lt;[Is Current Month]={1}&amp;gt;}[Date_Num])-1)"}&amp;gt;}Periodic )&lt;BR /&gt;,&lt;BR /&gt;-1*above( Sum( {&amp;lt;[Year Month]=, MonthDiff={0},Scenario={Actual},Date_Num={"&amp;lt;$(=Max({1&amp;lt;[Is Current Month]={1}&amp;gt;}[Date_Num])-1)"}&amp;gt;}Periodic ))*avg(1)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;kindly advise&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 07:54:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074187#M88105</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2023-05-23T07:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the Range Sum</title>
      <link>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074330#M88128</link>
      <description>&lt;P&gt;You may just use your main-expression as a boolean check, like:&lt;/P&gt;
&lt;P&gt;VarianceExpression * sign(MainExpression)&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 11:03:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074330#M88128</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-05-23T11:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the Range Sum</title>
      <link>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074433#M88135</link>
      <description>&lt;P&gt;may you please elaborate more?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 13:53:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074433#M88135</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2023-05-23T13:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the Range Sum</title>
      <link>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074459#M88138</link>
      <description>&lt;P&gt;It's not complicated. Your fabs(rangesum(above(...))) creates future-results for not existing values just repeating the last result for all further exists dimension-values. In general it should be possible to add further condition within this variance-expression but it won't be trivial. Much easier is to put a boolean check on the outside. This means for all existing data your main-expression will return a (positive) value and sign() returns as a wrapper 1 and the not existing data results in 0 and sign returned 0 which means in the end that your variance-expression is multiplied with 1 respectively 0 and the zero-results could be hidden per layout-option.&lt;/P&gt;
&lt;P&gt;Beside using the MainExpression as check you might be also just add a 0/1 flag within the calendar related to dates &amp;lt;= monthend/montstart of today() respectively are &amp;gt;= and then using the flag as factor or as further dimension/expression-condition.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 14:32:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Limit-the-Range-Sum/m-p/2074459#M88138</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-05-23T14:32:27Z</dc:date>
    </item>
  </channel>
</rss>

