<?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 sum expression that works with cyclic group? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634204#M733218</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Say I have sum(Sales)&lt;/P&gt;&lt;P&gt;I want it as a cumulative sum over a time period, to start with Date&lt;/P&gt;&lt;P&gt;So say sum sales for 2019100&lt;STRONG&gt;1&lt;/STRONG&gt; is 200, for 2019100&lt;STRONG&gt;2&lt;/STRONG&gt; is 300, then it should show 200+300 as the value on 20191002 etc...&lt;/P&gt;&lt;P&gt;Then you can for example use the new for QV12 sortable AGGR function&lt;/P&gt;&lt;P&gt;Aggr(RangeSum(Above(sum(Sales), 0, RowNo())), YearMonth, (Date, (NUMERIC)))&lt;/P&gt;&lt;P&gt;This works for me.&lt;/P&gt;&lt;P&gt;HOWEVER&lt;/P&gt;&lt;P&gt;My time period is really not only Date, but it's a cyclic group with Date, YearWeek, YearMonth and Year&lt;/P&gt;&lt;P&gt;The above expression only works for Date, but not for the others&lt;/P&gt;&lt;P&gt;How do I make an expression with cumulative sum that works for this cyclic time group?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 19:54:58 GMT</pubDate>
    <dc:creator>joeallen</dc:creator>
    <dc:date>2024-11-16T19:54:58Z</dc:date>
    <item>
      <title>Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634204#M733218</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;Say I have sum(Sales)&lt;/P&gt;&lt;P&gt;I want it as a cumulative sum over a time period, to start with Date&lt;/P&gt;&lt;P&gt;So say sum sales for 2019100&lt;STRONG&gt;1&lt;/STRONG&gt; is 200, for 2019100&lt;STRONG&gt;2&lt;/STRONG&gt; is 300, then it should show 200+300 as the value on 20191002 etc...&lt;/P&gt;&lt;P&gt;Then you can for example use the new for QV12 sortable AGGR function&lt;/P&gt;&lt;P&gt;Aggr(RangeSum(Above(sum(Sales), 0, RowNo())), YearMonth, (Date, (NUMERIC)))&lt;/P&gt;&lt;P&gt;This works for me.&lt;/P&gt;&lt;P&gt;HOWEVER&lt;/P&gt;&lt;P&gt;My time period is really not only Date, but it's a cyclic group with Date, YearWeek, YearMonth and Year&lt;/P&gt;&lt;P&gt;The above expression only works for Date, but not for the others&lt;/P&gt;&lt;P&gt;How do I make an expression with cumulative sum that works for this cyclic time group?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:54:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634204#M733218</guid>
      <dc:creator>joeallen</dc:creator>
      <dc:date>2024-11-16T19:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634215#M733219</link>
      <description>&lt;P&gt;Try replacing your direct field in aggr sort argument by expression:&amp;nbsp;&lt;SPAN class="script_token"&gt;GetCurrentField (&lt;/SPAN&gt;&lt;SPAN class="bnf_token"&gt;group_name&lt;/SPAN&gt;&lt;SPAN class="statement"&gt;), like:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="statement"&gt;&lt;SPAN&gt;Aggr(RangeSum(Above(sum(Sales), 0, RowNo())), YearMonth, (&lt;STRONG&gt;&lt;SPAN class="script_token"&gt;GetCurrentField (&lt;/SPAN&gt;&lt;SPAN class="bnf_token"&gt;group_name&lt;/SPAN&gt;)&lt;/STRONG&gt;, (NUMERIC)))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 11:36:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634215#M733219</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-10-11T11:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634219#M733220</link>
      <description>&lt;P&gt;Correct me if I am wrong&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp;, but won't we need Dollar sign expansion here?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Aggr(
  RangeSum(Above(Sum(Sales), 0, RowNo()))
, YearMonth, ($(='[' &amp;amp; GetCurrentField (group_name) &amp;amp; ']'), (NUMERIC)))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Oct 2019 11:47:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634219#M733220</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-11T11:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634249#M733221</link>
      <description>&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;That is something I wanted to test and post. In fact I typed two possibilities as answer, one with $ and another without, then I thought that, since the getcurrentfield() would actually be evaluated with the chart (since it is dimension-selection sensitive) - the main expression and getcurrentfield() evaluation might work simultaneously. Again, not tested here.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:22:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634249#M733221</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-10-11T12:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634251#M733222</link>
      <description>&lt;P&gt;From my understanding of using this in the past, GetCurrentField() will just give the name of the field as a text... to actually make it read as a field, you will need $()... but let me know if you find otherwise while testing.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:23:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634251#M733222</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-11T12:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634259#M733223</link>
      <description>&lt;P&gt;If the field name doesn't contain &lt;STRONG&gt;space&lt;/STRONG&gt;, that should probably not matter. So it's not about evaluating before the actual expression gets evaluated, rather adding '[' ']' to give a field name convention for those even that has spaces in field name.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: I roughly tested and it works (without space in field name obviously)&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:40:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634259#M733223</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-10-11T12:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634264#M733224</link>
      <description>&lt;P&gt;Spaces is taken care by '[' and ']', but to convert it to field is done by $(=)... I still feel it is needed.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634264#M733224</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-11T12:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634265#M733225</link>
      <description>&lt;P&gt;Sunny, so yes, yours is a better approach since that would work in all scenarios.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:45:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634265#M733225</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-10-11T12:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634268#M733226</link>
      <description>&lt;P&gt;For some reason I don't see it working without $().. please check the attached file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:48:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634268#M733226</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-11T12:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634270#M733227</link>
      <description>Thanks for the idea Tresesco and for the correction Sunny.&lt;BR /&gt;&lt;BR /&gt;It works fine for Date and YearWeek (I want the cumulative sum to reset per YearMonth for Date and YearWeek so I want this expression as is for those two)&lt;BR /&gt;&lt;BR /&gt;However once the Cyclic group changes to YearMonth it doesn't work any more (it just sums like normal and not cumulative per YearMonth, I assume because of the YearMonth grouping in the expression that works so well for YearWeek and Date. And Year doesn't work at all.&lt;BR /&gt;I guess have to use some kind of If function here to get YearMonth and Year to work?&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:50:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634270#M733227</guid>
      <dc:creator>joeallen</dc:creator>
      <dc:date>2019-10-11T12:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634274#M733228</link>
      <description>&lt;P&gt;Yes, some sort of if statement would be needed to get this to work.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 12:59:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634274#M733228</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-11T12:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634276#M733229</link>
      <description>&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;I tried expression:&amp;nbsp; =&lt;FONT face="courier new,courier"&gt;Avg(F3)&amp;amp; Count(GetCurrentField([Group]))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;and it works, I guess it's about scope where/when you are using this. Today I have to log off early, but definitely will come back and do some more testing..&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 13:02:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634276#M733229</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-10-11T13:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634277#M733230</link>
      <description>So simply an If statement when GetCurrentField is Date or YearWeek, then have the expression as YearMonth grouping, and if GetCurrentField is YearMonth, have Year as grouping in the expression, for example?</description>
      <pubDate>Fri, 11 Oct 2019 13:02:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634277#M733230</guid>
      <dc:creator>joeallen</dc:creator>
      <dc:date>2019-10-11T13:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634278#M733231</link>
      <description>&lt;P&gt;I don't think that this is working as you might be expecting.&amp;nbsp;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;FONT face="courier new,courier"&gt;Avg(F3)&amp;amp; Count(GetCurrentField([Group])).&amp;nbsp;All it is doing is to Counting the text... not the field itself.... Try this&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;=Avg(F3)&amp;amp; Concat(DISTINCT GetCurrentField([Group])) and you will see F2 instead of AA and BB when you are on F2 within your group.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 13:07:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634278#M733231</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-11T13:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634280#M733232</link>
      <description>&lt;P&gt;I think so, exact expression will have to tested out but you can have an overarching if statement or you can have an if statement just for your dimensions part.... but your idea is right&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 13:08:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1634280#M733232</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-11T13:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum expression that works with cyclic group?</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1635267#M733233</link>
      <description>&lt;P&gt;Spot on Sunny. Thanks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 08:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-expression-that-works-with-cyclic-group/m-p/1635267#M733233</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2019-10-15T08:58:47Z</dc:date>
    </item>
  </channel>
</rss>

