<?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 by week. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1575684#M741794</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am trying to calculate&amp;nbsp; cumulative sum by week. At the end of any week I am trying to get the totals from beginning of the time to the end of week selected. I am able to achieve a part of it by below expression&lt;/P&gt;&lt;P&gt;RangeSum(Above(TOTAL count({&amp;lt;DateType={'Dispute'}&amp;gt; } disputeTransactionId ), 0, RowNo(TOTAL)))&lt;/P&gt;&lt;P&gt;My chart&amp;nbsp; has&amp;nbsp; weekName dimension and&amp;nbsp; different measures.&lt;/P&gt;&lt;P&gt;However when a selection&amp;nbsp; is made on year/month/week (which are the different filters in my report) the cumulative sums are changing according to the selections made. What I am trying to achieve is when a particular week is selected I wanted to know the cumulative totals from begining of the time to that week selected. Users might also select not contiguous weeks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SG.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>SRG</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Cumulative sum by week.</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1575684#M741794</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I am trying to calculate&amp;nbsp; cumulative sum by week. At the end of any week I am trying to get the totals from beginning of the time to the end of week selected. I am able to achieve a part of it by below expression&lt;/P&gt;&lt;P&gt;RangeSum(Above(TOTAL count({&amp;lt;DateType={'Dispute'}&amp;gt; } disputeTransactionId ), 0, RowNo(TOTAL)))&lt;/P&gt;&lt;P&gt;My chart&amp;nbsp; has&amp;nbsp; weekName dimension and&amp;nbsp; different measures.&lt;/P&gt;&lt;P&gt;However when a selection&amp;nbsp; is made on year/month/week (which are the different filters in my report) the cumulative sums are changing according to the selections made. What I am trying to achieve is when a particular week is selected I wanted to know the cumulative totals from begining of the time to that week selected. Users might also select not contiguous weeks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SG.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1575684#M741794</guid>
      <dc:creator>SRG</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by week.</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1575687#M741796</link>
      <description>I've added some set modifiers. Try this:&lt;BR /&gt;&lt;BR /&gt;RangeSum(Above(TOTAL count({&amp;lt;year,month,week, DateField = {"&amp;lt;$(=maxstring(DateField))"},DateType={'Dispute'}&amp;gt; } disputeTransactionId ), 0, RowNo(TOTAL)))</description>
      <pubDate>Thu, 02 May 2019 04:27:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1575687#M741796</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-05-02T04:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by week.</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1575961#M741797</link>
      <description>&lt;P&gt;Thank you for the very quick response. However the I dont see any changes in the results. For example the below chart is working fine when no selection is made on the week dimension. If any week is chosen for example 2018/27 (27 week of year 2018) my expectation is Disputes field should show 1 and cumSum filed should show 3, but when its not working. Just an FYI I am using a canonical calendar that links all my disputes,invoices. All my date dimensions are from the canonical Calendar&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sampleData.JPG" style="width: 262px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/11332iBFFE66809C5361D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="sampleData.JPG" alt="sampleData.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 14:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1575961#M741797</guid>
      <dc:creator>SRG</dc:creator>
      <dc:date>2019-05-02T14:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by week.</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1576002#M741798</link>
      <description>&lt;P&gt;As ABOVE will look in the row above in the chart I don't think you can do what you want with an expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could however try to use an AsOf table. Take a look at the chart I created from the script below script below:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Without selections&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 524px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/11339iEF001797237F2AEB/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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;With selection in AsOfWeek&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 535px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/11338iF3697F90DEDCE43F/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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[Master Calendar]:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LOAD&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Id as disputeTransactionId, Date as DateField, Year(Date) as Year, Month(Date) as Month, WeekName(Date) as Week, 'Dispute' as DateType, Amount&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Inline [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Id, Date, Amount&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;1,2019-03-09,78&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2,2019-03-10,32&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;3,2019-03-12,30&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;4,2019-03-18,57&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;5,2019-03-06,59&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;6,2019-03-04,74&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;7,2019-03-02,30&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;8,2019-03-13,53&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;9,2019-03-03,65&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;10,2019-03-03,60&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;11,2019-02-13,53&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;12,2019-02-03,65&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;13,2019-02-03,60&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;];&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;tmpAsOfCal:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load distinct &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Week,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;autonumber(Week,'Week') as WeekSerial&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident [Master Calendar]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;order by Week ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// FULLL OUTER JOIN ON IT SELF&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Join (tmpAsOfCal)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load Week as AsOfWeek&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident tmpAsOfCal ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[AsOfCalendar]:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Week,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;AsOfWeek,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;autonumber(AsOfWeek,'Week') - WeekSerial as WeekDiff&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident tmpAsOfCal&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Where AsOfWeek &amp;gt;= Week&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;order by Week&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Drop Table tmpAsOfCal;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 15:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1576002#M741798</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-05-02T15:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by week.</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1587403#M741799</link>
      <description>&lt;P&gt;Vegar,&lt;/P&gt;&lt;P&gt;It took long for me to reply on this. First of all thank you very much for the solution. It solved part of my problem. I guess it only works for presenting weekly cumulative. If I have to do it by both monthly and weekly can you please suggest me the changes I need to do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jun 2019 17:40:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1587403#M741799</guid>
      <dc:creator>SRG</dc:creator>
      <dc:date>2019-06-02T17:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by week.</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1587408#M741800</link>
      <description>&lt;P&gt;I guess you could change default from AsOfWeek to AsOfDateField and&amp;nbsp; add two lines into the AsOfCalendar in my previous code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF( Monthname(AsOfDateField)=AsOfDateField ,MonthName(AsOfDateField))as AsOfMonth,
IF( weekname(AsOfDateField)=AsOfDateField ,weekname(AsOfDateField))as AsOfWeek,&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The new code look something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[Master Calendar]:
LOAD
Id as disputeTransactionId, Date as DateField, Year(Date) as Year, Month(Date) as Month, WeekName(Date) as Week, 'Dispute' as DateType, Amount
Inline [
Id, Date, Amount
1,2019-03-09,78
2,2019-03-10,32
3,2019-03-12,30
4,2019-03-18,57
5,2019-03-06,59
6,2019-03-04,74
7,2019-03-02,30
8,2019-03-13,53
9,2019-03-03,65
10,2019-03-03,60
11,2019-02-13,53
12,2019-02-03,65
13,2019-02-03,60
];
tmpAsOfCal:
Load distinct 
DateField,
autonumber(DateField,'DateField') as DateFieldSerial
Resident [Master Calendar]
order by DateField ;

// FULLL OUTER JOIN ON IT SELF
Join (tmpAsOfCal)
Load DateField as AsOfDateField
Resident tmpAsOfCal ;

[AsOfCalendar]:
Load 
DateField,
AsOfDateField,

IF( Monthname(AsOfDateField)=AsOfDateField ,MonthName(AsOfDateField))as AsOfMonth,
IF( weekname(AsOfDateField)=AsOfDateField ,weekname(AsOfDateField))as AsOfWeek,
autonumber(AsOfDateField,'DateField') - DateFieldSerial as DateFieldDiff
Resident tmpAsOfCal
Where AsOfDateField &amp;gt;= DateField
order by DateField
;

Drop Table tmpAsOfCal;

exit script;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use AsOfWeek when accumilating on week basis and AsOfMonth when acc on month etc.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jun 2019 19:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1587408#M741800</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-02T19:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative sum by week.</title>
      <link>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1591762#M741801</link>
      <description>&lt;P&gt;Thank you very much for the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 15:56:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cumulative-sum-by-week/m-p/1591762#M741801</guid>
      <dc:creator>SRG</dc:creator>
      <dc:date>2019-06-13T15:56:11Z</dc:date>
    </item>
  </channel>
</rss>

