<?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: Cumulative sum by month and type in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115892#M91052</link>
    <description>&lt;P&gt;Oops, missed the closing bracket&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=Sum(aggr(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; rangesum(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; above(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; Sum( distinct {&amp;lt;Table = {"SIP"}, [Course Title] = {"ImpP*"},Date="&amp;gt;$(=today())"}&amp;gt;}CTMAP)&amp;nbsp; &amp;nbsp; &amp;nbsp;,0,rowno())&amp;nbsp; ),MonthYearDate,&amp;nbsp; BLMAP)&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;It will create the temporary table based on MonthYear &amp;amp; BLMAP field with sum(CTMAP) expression and then do the summation of the end result.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 10:01:22 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2023-09-12T10:01:22Z</dc:date>
    <item>
      <title>Cumulative sum by month and type</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115864#M91048</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Back with this formula again:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=aggr(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; rangesum(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; above(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; Sum( distinct {&amp;lt;Table = {"SIP"}, [Course Title] = {"ImpP*"},Date="&amp;gt;$(=today())"}&amp;gt;}CTMAP)&amp;nbsp; &amp;nbsp; &amp;nbsp;,0,rowno())&amp;nbsp; ),MonthYearDate&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is summing the distinct CTMAP values in each month, and providing cumulative total. This works fine.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; I now need to factor in a new field, BLMAP. BLMAP has two instances per month, each with the same value of CTMAP. This means that the above formula will ignore one instance of BLMAP due to distinct CTMAP, so I need to amend the formula to take both BLMAP instances into account. So currently say a monthly CTMAP value of 45 is being added to the cumulative sum, but I need a CTMAP value of 45*2 = 90 to be added instead.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I've tried adding in aggr(,BLMAP) into the above function in front of the current Sum, above, rangesum and aggr but none of these seem to calculate correctly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I've also tried adding in BLMAP to the overall aggr ie. aggr( , MonthYearDate, BLMAP) and&amp;nbsp;&amp;nbsp;aggr( , BLMAP, MonthYearDate ) but these are just calculating one single value of CTMAP across the whole time period.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can someone help?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sarah&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 09:09:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115864#M91048</guid>
      <dc:creator>Sa_Rah</dc:creator>
      <dc:date>2023-09-12T09:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by month and type</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115873#M91049</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Try like below&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=Sum(aggr(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; rangesum(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; above(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; Sum( distinct {&amp;lt;Table = {"SIP"}, [Course Title] = {"ImpP*"},Date="&amp;gt;$(=today())"}&amp;gt;}CTMAP)&amp;nbsp; &amp;nbsp; &amp;nbsp;,0,rowno())&amp;nbsp; ),MonthYearDate,&amp;nbsp; BLMAP)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 09:45:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115873#M91049</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2023-09-12T09:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by month and type</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115886#M91050</link>
      <description>&lt;P&gt;Thanks! It doesn't quite seem to be working, should there be an additional bracket somewhere?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I should probably add that BLMAP is a text field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Really appreciate the help!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 09:59:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115886#M91050</guid>
      <dc:creator>Sa_Rah</dc:creator>
      <dc:date>2023-09-12T09:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by month and type</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115892#M91052</link>
      <description>&lt;P&gt;Oops, missed the closing bracket&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=Sum(aggr(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; rangesum(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; above(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; Sum( distinct {&amp;lt;Table = {"SIP"}, [Course Title] = {"ImpP*"},Date="&amp;gt;$(=today())"}&amp;gt;}CTMAP)&amp;nbsp; &amp;nbsp; &amp;nbsp;,0,rowno())&amp;nbsp; ),MonthYearDate,&amp;nbsp; BLMAP)&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;It will create the temporary table based on MonthYear &amp;amp; BLMAP field with sum(CTMAP) expression and then do the summation of the end result.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 10:01:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2115892#M91052</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2023-09-12T10:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by month and type</title>
      <link>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2116086#M91071</link>
      <description>&lt;P&gt;Thanks - I tried this formula and I think it did exactly as you described, calculated both for month and for cohort and then added together. It seemed to ignore the range sum element however and just calculated the above for the months individually.&lt;/P&gt;
&lt;P&gt;However in playing around with this I chanced upon a solution (change highlighted in bold below),&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=aggr(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; rangesum(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; above(&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; Sum( &lt;STRONG&gt;aggr(&lt;/STRONG&gt;distinct {&amp;lt;Table = {"SIP"}, [Course Title] = {"ImpP*"},Date="&amp;gt;$(=today())"}&amp;gt;} &lt;STRONG&gt;Min(CTMAP),BLMAP)&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;)&amp;nbsp; &amp;nbsp;,0,rowno())&amp;nbsp; ),MonthYearDate&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 14:15:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cumulative-sum-by-month-and-type/m-p/2116086#M91071</guid>
      <dc:creator>Sa_Rah</dc:creator>
      <dc:date>2023-09-12T14:15:24Z</dc:date>
    </item>
  </channel>
</rss>

