<?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 How to get cumulative values for each dimension in load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546981#M1127881</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading a table of sales transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date,&lt;/P&gt;&lt;P&gt;Customer,&lt;/P&gt;&lt;P&gt;Invoice Ref,&lt;/P&gt;&lt;P&gt;Sales Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading the data for 3 years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a field showing cumulative Sales Value for each Customer, for each year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: In fact I think I need a new table showing Customer, Year, Cumulative Sales Valie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Dec 2013 11:17:28 GMT</pubDate>
    <dc:creator>mazacini</dc:creator>
    <dc:date>2013-12-09T11:17:28Z</dc:date>
    <item>
      <title>How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546981#M1127881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading a table of sales transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date,&lt;/P&gt;&lt;P&gt;Customer,&lt;/P&gt;&lt;P&gt;Invoice Ref,&lt;/P&gt;&lt;P&gt;Sales Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading the data for 3 years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a field showing cumulative Sales Value for each Customer, for each year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: In fact I think I need a new table showing Customer, Year, Cumulative Sales Valie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 11:17:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546981#M1127881</guid>
      <dc:creator>mazacini</dc:creator>
      <dc:date>2013-12-09T11:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546982#M1127883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;sum({&amp;lt;Customer ={'*'} + date(year(Date, 'YYYY') = {'*'}&amp;gt;} Sales Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;BR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Michael&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 11:30:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546982#M1127883</guid>
      <dc:creator>maternmi</dc:creator>
      <dc:date>2013-12-09T11:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546983#M1127886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I use this in my load script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 11:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546983#M1127886</guid>
      <dc:creator>mazacini</dc:creator>
      <dc:date>2013-12-09T11:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546984#M1127889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should load a second table order by date and customer, and use the peek () or previous() functions. Sth like:&lt;/P&gt;&lt;P&gt;NOCONCATENATE&lt;/P&gt;&lt;P&gt;LOAD Date, Customer,InvoiceRef,SalesValue&lt;/P&gt;&lt;P&gt;if(Customer =peek('Customer') AND Year(Date) = previous(Year(Date), SalesValues+peek('SalesValue'), Null() ) as 'CumulSalesvalue'&lt;/P&gt;&lt;P&gt;Resident FirstTable&lt;/P&gt;&lt;P&gt;ORDER BY Customer, Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop FirstTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 11:45:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546984#M1127889</guid>
      <dc:creator />
      <dc:date>2013-12-09T11:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546985#M1127892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry, haven't read your subject correct.&amp;nbsp; I think Fabrice's suggestion should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 12:09:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546985#M1127892</guid>
      <dc:creator>maternmi</dc:creator>
      <dc:date>2013-12-09T12:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546986#M1127894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Fabrice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution worked - with the following changes:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if(Customer =peek('Customer') AND Year(Date) = previous(Year(Date)&lt;STRONG style="text-decoration: underline;"&gt;)&lt;/STRONG&gt;, SalesValue&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG style="text-decoration: line-through;"&gt;s&lt;/STRONG&gt;&lt;/SPAN&gt;+peek('&lt;STRONG style="text-decoration: underline;"&gt;Cumul&lt;/STRONG&gt;SalesValue'), SalesValue&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&lt;STRONG&gt;Null()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; ) as 'CumulSalesvalue'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I ask how I might create a table of cumulative value for each customer for the last date in each year that the customer got an invoice for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if a customer's last invoice was in February, it would extract the cumulative value up to February; if last invoice was July, extracts a cumulative value to July.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thanks for your help so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 12:11:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546986#M1127894</guid>
      <dc:creator>mazacini</dc:creator>
      <dc:date>2013-12-09T12:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546987#M1127898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, you need to find the maximum month whatever the year:&lt;/P&gt;&lt;P&gt;Before the NOCONCATENATE&lt;/P&gt;&lt;P&gt;LEFT JOIN (MyTable)&lt;/P&gt;&lt;P&gt;LOAD Customer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;))) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;LastInvoice&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;RESIDENT&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;STRONG style="color: #ff8000; font-size: 10pt;"&gt;&lt;STRONG style="color: #ff8000; font-size: 10pt;"&gt;MyTable &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff8000; font-size: 10pt;"&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Group&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;By&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Customer&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;In the NOCONCATENATE statement, in the peek part&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;add sth like &lt;/SPAN&gt;AND&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Num&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 10pt;"&gt;LastInvoice &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your if statment contains different sub if in order to return either a simple amount (first month for example to initiate the cumulative value) or a null() value&amp;nbsp; (when Month &amp;gt; LastInvoice)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see the qvw and xls files.&lt;/P&gt;&lt;P&gt;There are Prod, Country and Date dimensions. Amounts and Units fields CumulAmounts has been created&lt;/P&gt;&lt;P&gt;P1 is sold until last month (march). P2 is sold only until during january this year even though it has been sold during several months last year. There are two years (2012 and 2013)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 15:11:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546987#M1127898</guid>
      <dc:creator />
      <dc:date>2013-12-09T15:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546988#M1127901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabrice&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I only have personal edition. Could you send me script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 20:43:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546988#M1127901</guid>
      <dc:creator>mazacini</dc:creator>
      <dc:date>2013-12-09T20:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546989#M1127904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;of course.&lt;/P&gt;&lt;P&gt;Please find the Word doc with the script out the QVW.&lt;/P&gt;&lt;P&gt;I have created no&amp;nbsp; object: I just checked the data with the Table Viewer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can load the previous XLS file to see what I wanted to do. Please adapt the code to your own case.&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;&lt;P&gt;I have also the Personal Edition&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 20:49:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546989#M1127904</guid>
      <dc:creator />
      <dc:date>2013-12-09T20:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to get cumulative values for each dimension in load</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546990#M1127905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your help. Your suggestions led me to a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 22:07:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-get-cumulative-values-for-each-dimension-in-load/m-p/546990#M1127905</guid>
      <dc:creator>mazacini</dc:creator>
      <dc:date>2013-12-12T22:07:05Z</dc:date>
    </item>
  </channel>
</rss>

