<?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 Rolling in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773407#M455165</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm having this problem with my code, i have a table as you can see below:&lt;/P&gt;&lt;P&gt;Table&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;Date, Customer, Sales&lt;BR /&gt;01/07/2012, A, 100&lt;BR /&gt;01/08/2012, A, 100&lt;BR /&gt;01/09/2012, A, 100&lt;BR /&gt;01/10/2012, A, 100&lt;BR /&gt;&lt;BR /&gt;01/04/2012, B, 50&lt;BR /&gt;01/05/2012, B, 50&lt;BR /&gt;01/06/2012, B, 50&lt;BR /&gt;01/07/2012, B, 50&lt;BR /&gt;&lt;BR /&gt;01/11/2012, A, 100&lt;BR /&gt;01/12/2012, A,&amp;nbsp;100&lt;BR /&gt;01/01/2013, A,&amp;nbsp;100&lt;BR /&gt;01/02/2013, A,&amp;nbsp;100&lt;BR /&gt;&lt;BR /&gt;01/10/2012, B, 50&lt;BR /&gt;01/11/2012, B, 50&lt;BR /&gt;01/12/2012, B, 50&lt;BR /&gt;01/01/2013, B, 50&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;I Want to get a table with Rolling sales where the results are like this :&lt;/P&gt;&lt;P&gt;If i select Customer A for example :&lt;/P&gt;&lt;P&gt;Date, Customer, Sales, Rolling Sales&lt;BR /&gt;01/07/2012, A, 100, 100&lt;BR /&gt;01/08/2012, A, 100, 200&lt;BR /&gt;01/09/2012, A, 100, 300&lt;BR /&gt;01/10/2012, A, 100, 400&lt;BR /&gt;01/11/2012, A, 100, 500&lt;BR /&gt;01/12/2012, A,&amp;nbsp;100, 600&lt;BR /&gt;01/01/2013, A,&amp;nbsp;100, 700&lt;BR /&gt;01/02/2013, A,&amp;nbsp;100, 800&lt;/P&gt;&lt;P&gt;I tried the code below:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;If(Customer = previous(Customer), RangeSum(Sales,Peek('Rolling')), Sales) as Rolling&lt;BR /&gt;Resident Table&lt;BR /&gt;;&lt;BR /&gt;DROP Table Table;&lt;/P&gt;&lt;P&gt;Any suggestions or other ways to achieve that result is much appreciated, Thank you&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2021 15:04:15 GMT</pubDate>
    <dc:creator>WalidChoukri</dc:creator>
    <dc:date>2021-01-11T15:04:15Z</dc:date>
    <item>
      <title>Rolling in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773407#M455165</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm having this problem with my code, i have a table as you can see below:&lt;/P&gt;&lt;P&gt;Table&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;BR /&gt;Date, Customer, Sales&lt;BR /&gt;01/07/2012, A, 100&lt;BR /&gt;01/08/2012, A, 100&lt;BR /&gt;01/09/2012, A, 100&lt;BR /&gt;01/10/2012, A, 100&lt;BR /&gt;&lt;BR /&gt;01/04/2012, B, 50&lt;BR /&gt;01/05/2012, B, 50&lt;BR /&gt;01/06/2012, B, 50&lt;BR /&gt;01/07/2012, B, 50&lt;BR /&gt;&lt;BR /&gt;01/11/2012, A, 100&lt;BR /&gt;01/12/2012, A,&amp;nbsp;100&lt;BR /&gt;01/01/2013, A,&amp;nbsp;100&lt;BR /&gt;01/02/2013, A,&amp;nbsp;100&lt;BR /&gt;&lt;BR /&gt;01/10/2012, B, 50&lt;BR /&gt;01/11/2012, B, 50&lt;BR /&gt;01/12/2012, B, 50&lt;BR /&gt;01/01/2013, B, 50&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;I Want to get a table with Rolling sales where the results are like this :&lt;/P&gt;&lt;P&gt;If i select Customer A for example :&lt;/P&gt;&lt;P&gt;Date, Customer, Sales, Rolling Sales&lt;BR /&gt;01/07/2012, A, 100, 100&lt;BR /&gt;01/08/2012, A, 100, 200&lt;BR /&gt;01/09/2012, A, 100, 300&lt;BR /&gt;01/10/2012, A, 100, 400&lt;BR /&gt;01/11/2012, A, 100, 500&lt;BR /&gt;01/12/2012, A,&amp;nbsp;100, 600&lt;BR /&gt;01/01/2013, A,&amp;nbsp;100, 700&lt;BR /&gt;01/02/2013, A,&amp;nbsp;100, 800&lt;/P&gt;&lt;P&gt;I tried the code below:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;If(Customer = previous(Customer), RangeSum(Sales,Peek('Rolling')), Sales) as Rolling&lt;BR /&gt;Resident Table&lt;BR /&gt;;&lt;BR /&gt;DROP Table Table;&lt;/P&gt;&lt;P&gt;Any suggestions or other ways to achieve that result is much appreciated, Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 15:04:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773407#M455165</guid>
      <dc:creator>WalidChoukri</dc:creator>
      <dc:date>2021-01-11T15:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773452#M455166</link>
      <description>&lt;P&gt;Maybe you can do it like below :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;If(Customer = previous(Customer), Peek('Rolling'), 0) +Sales as Rolling&lt;/P&gt;&lt;P&gt;Resident Table;&lt;/P&gt;&lt;P&gt;DROP Table Table;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 17:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773452#M455166</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-01-11T17:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773621#M455167</link>
      <description>&lt;P&gt;Thanks for your reply, in fact your expression would work just the same as mine,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3.PNG" style="width: 397px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/46804i5237CBA1D82D6188/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.PNG" alt="3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;the problem i'm facing is how to get the last rolling sales of the customer A, as the loading order alternate between Customer A and B, the system re calculate from scratch, i don't know if my description is clear enough, but what i need is the moment the program handle a different customer it'll try to search if there's any previous records of the same customer if yes it'll add the latest rolling sales if not it'll start over.&lt;/P&gt;&lt;P&gt;Again thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 08:27:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773621#M455167</guid>
      <dc:creator>WalidChoukri</dc:creator>
      <dc:date>2021-01-12T08:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773687#M455168</link>
      <description>&lt;P&gt;To use this approach you need to control the load order of your data. Try adding an order by like below.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LOAD *,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;If([Customer] = &lt;STRONG&gt;peek&lt;/STRONG&gt;('Customer'), Peek('Rolling'), 0) + [Sales] as Rolling&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="courier new,courier"&gt;Resident Table&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;Order by [Customer], [Date]&lt;/FONT&gt;&amp;nbsp;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DROP Table Table;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 11:56:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773687#M455168</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-01-12T11:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773693#M455169</link>
      <description>&lt;P&gt;Like this as well:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;If(Customer &amp;lt;&amp;gt; previous(Customer),Sales, Peek(Rolling)+Sales) as Rolling&lt;/P&gt;&lt;P&gt;Resident table&lt;/P&gt;&lt;P&gt;order by Customer , Date;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 12:18:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773693#M455169</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2021-01-12T12:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling in script</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773696#M455170</link>
      <description>&lt;P&gt;Thanks a lot.&amp;nbsp; It worked.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 12:26:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-in-script/m-p/1773696#M455170</guid>
      <dc:creator>WalidChoukri</dc:creator>
      <dc:date>2021-01-12T12:26:57Z</dc:date>
    </item>
  </channel>
</rss>

