<?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 Creating cumulative percent variable in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995029#M970949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to Qlik, I have the following dataset: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spend(containing 6 columns):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 485px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="18" width="113"&gt;Managed Category&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="71"&gt;Material&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="72"&gt;MaterialCat&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="62"&gt;MatSpend&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="58"&gt;MCSpend&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="109"&gt;Perc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.454545455&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1D&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1D&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;8000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.363636364&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.090909091&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1C&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1C&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.090909091&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1E&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1E&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1F&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1F&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1G&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1G&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1T&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1T&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.142857143&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create another column in the script that is a cumulative sum of the Perc column and get the result set like this&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 545px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="18" width="102"&gt;Material&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="102"&gt;Managed Category&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="239"&gt;CumulativePerc&lt;/TD&gt;&lt;TD class="xl63" style="border-left-style: none; text-align: right; vertical-align: baseline;" width="102"&gt;MatSpend&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.454545455&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1D&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.818181818&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;8000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.909090909&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1C&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1E&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1F&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.571428571&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1G&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.857142857&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1T&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I have tried using the Peek and Previous functions in the various ways I found in this forum, but everything results in one or more rows getting duplicated. I would really appreciate any help I can get, I am not able to solve this! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA the raw data file and the QVW: &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Sep 2015 01:52:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-09-22T01:52:28Z</dc:date>
    <item>
      <title>Creating cumulative percent variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995029#M970949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to Qlik, I have the following dataset: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spend(containing 6 columns):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 485px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="18" width="113"&gt;Managed Category&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="71"&gt;Material&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="72"&gt;MaterialCat&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="62"&gt;MatSpend&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="58"&gt;MCSpend&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="109"&gt;Perc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.454545455&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1D&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1D&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;8000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.363636364&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.090909091&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1C&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A-1C&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;22000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.090909091&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1E&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1E&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1F&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1F&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1G&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1G&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1T&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B-1T&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1000&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;7000&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;0.142857143&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create another column in the script that is a cumulative sum of the Perc column and get the result set like this&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 545px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="18" width="102"&gt;Material&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="102"&gt;Managed Category&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="239"&gt;CumulativePerc&lt;/TD&gt;&lt;TD class="xl63" style="border-left-style: none; text-align: right; vertical-align: baseline;" width="102"&gt;MatSpend&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1A&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.454545455&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1D&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.818181818&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;8000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1B&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.909090909&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1C&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1E&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.285714286&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1F&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.571428571&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1G&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;0.857142857&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="18" style="border-top: none;"&gt;1T&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top-style: none; border-left-style: none; text-align: right; vertical-align: baseline;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I have tried using the Peek and Previous functions in the various ways I found in this forum, but everything results in one or more rows getting duplicated. I would really appreciate any help I can get, I am not able to solve this! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA the raw data file and the QVW: &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 01:52:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995029#M970949</guid>
      <dc:creator />
      <dc:date>2015-09-22T01:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Creating cumulative percent variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995030#M970950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco;"&gt;If(Previous([Managed Category])=[Managed Category], RangeSum(Peek('&lt;STRONG&gt;CumulativePerc&lt;/STRONG&gt;'), Perc), Perc) as &lt;STRONG&gt;CumulativePerc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 05:07:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995030#M970950</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-09-22T05:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating cumulative percent variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995031#M970951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Category, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Managed Category]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TestBook1.xlsx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Join(Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Category, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Material, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Spend&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TestBook1.xlsx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml, embedded labels, table is Sheet2);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Join(Table)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [Managed Category],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Sum(Spend)as MCSpend&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By [Managed Category];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NewTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [Managed Category],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Material,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; [Managed Category] &amp;amp; '-' &amp;amp; Material as MaterialCat,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Sum(Spend) as MatSpend,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; MCSpend,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Sum(Spend)/MCSpend as Perc&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Group By [Managed Category], Material, MCSpend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FinalTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; If(Peek('Managed Category') = [Managed Category], Alt(Peek('CumulativePerc'), 0) + Perc, Perc) as CumulativePerc&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident NewTable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By [Managed Category], MatSpend desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table NewTable;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output in Table Box:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/99599_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Sep 2015 05:14:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995031#M970951</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-09-22T05:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating cumulative percent variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995032#M970952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny! It worked! Any idea why it wouldn't work without the Alt() ? Again, thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Sep 2015 19:31:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/995032#M970952</guid>
      <dc:creator />
      <dc:date>2015-09-24T19:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating cumulative percent variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/1577856#M970953</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to do something similar to this, with a little bit added on at the end. Here's what i have so far&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Classcreate1:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;NoConcatenate Load&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Item_ID,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;If([LTM Total Value € (All)]&amp;gt;0,[LTM Total Value € (All)],0) as [Value]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;resident Data_Values_New&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;where [Reporting Date]='31/03/2019';&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Left Join (Classcreate1)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Load&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Item_ID,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;[Country]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;resident Data_Item_New_3;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Classcreate2:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;NoConcatenate Load*,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Recno() as [Order#]&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Resident Classcreate1&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Order By [Country]desc,[Value]desc,;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Drop table Classcreate1;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now trying to add in the percentage value, then cumulative percentage (based on country) and then eventually a categorization based on the cumulative percentage (something like the below)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If([**bleep**%]&amp;lt;.8,'Class A',if([**bleep**%]&amp;lt;.95,'Class B','Class C')) as Class&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I tried replicating what you had posted but I cant get it to work, are you able to offer any assistance?&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 10:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/1577856#M970953</guid>
      <dc:creator>ksharpes</dc:creator>
      <dc:date>2019-05-08T10:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating cumulative percent variable in script</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/1577924#M970954</link>
      <description>&lt;P&gt;never mind i did it!&lt;/P&gt;&lt;P&gt;Although now for some reason it failed on creating a search index, I have turned it off for now.&lt;/P&gt;&lt;P&gt;Classcreate1:&lt;BR /&gt;NoConcatenate Load&lt;BR /&gt;Item_ID,&lt;BR /&gt;If([LTM Total Value € (All)]&amp;gt;0,[LTM Total Value € (All)],0) as [Value],&lt;BR /&gt;[Stock Status2]&lt;BR /&gt;resident Data_Values_New&lt;BR /&gt;where [Reporting Date]='31/03/2019';&lt;/P&gt;&lt;P&gt;Left Join (Classcreate1)&lt;BR /&gt;Load&lt;BR /&gt;Item_ID,&lt;BR /&gt;[Country]&lt;BR /&gt;&lt;BR /&gt;resident Data_Item_New_3;&lt;/P&gt;&lt;P&gt;Classcreate2:&lt;BR /&gt;NoConcatenate Load*,&lt;BR /&gt;Recno() as [Order#]&lt;BR /&gt;Resident Classcreate1&lt;BR /&gt;Order By [Country]desc,[Value]desc,;&lt;BR /&gt;Drop table Classcreate1;&lt;/P&gt;&lt;P&gt;Left Join (Classcreate2)&lt;BR /&gt;Load&lt;BR /&gt;[Country],&lt;BR /&gt;sum(Value) as [CountryValue]&lt;BR /&gt;Resident Classcreate2&lt;BR /&gt;Group by [Country];&lt;/P&gt;&lt;P&gt;Classcreate3:&lt;BR /&gt;NoConcatenate Load&lt;BR /&gt;[Item_ID],&lt;BR /&gt;[Country],&lt;BR /&gt;sum(Value/[CountryValue]) As Perc&lt;BR /&gt;Resident Classcreate2&lt;BR /&gt;Group by [Item_ID], [Country];&lt;BR /&gt;Left Join (Classcreate3)&lt;BR /&gt;Load&lt;BR /&gt;[Order#],&lt;BR /&gt;Item_ID,&lt;BR /&gt;[Value],&lt;BR /&gt;[CountryValue],&lt;BR /&gt;[Stock Status2]&lt;BR /&gt;Resident Classcreate2;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Drop table Classcreate2;&lt;/P&gt;&lt;P&gt;Classcreate4:&lt;BR /&gt;Load*,&lt;/P&gt;&lt;P&gt;IF([Stock Status2]='Available',If([CumulativePerc]&amp;lt;.8,'Class A',if([CumulativePerc]&amp;lt;.95,'Class B','Class C')),[Stock Status2]) as Class;&lt;/P&gt;&lt;P&gt;Load*,&lt;BR /&gt;If(Peek('Country') = [Country], Alt(Peek('CumulativePerc'), 0) + Perc, Perc) as CumulativePerc&lt;BR /&gt;Resident Classcreate3&lt;BR /&gt;Order by [Order#];&lt;BR /&gt;Drop table Classcreate3;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Data_Values_New2:&lt;BR /&gt;NoConcatenate Load*&lt;BR /&gt;Resident Data_Values_New;&lt;/P&gt;&lt;P&gt;Left join (Data_Values_New2)&lt;/P&gt;&lt;P&gt;Load [Item_ID],&lt;BR /&gt;[Class]&lt;BR /&gt;Resident Classcreate4;&lt;BR /&gt;Drop table Classcreate4;&lt;BR /&gt;Drop table Data_Values_New;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2019 12:12:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-cumulative-percent-variable-in-script/m-p/1577924#M970954</guid>
      <dc:creator>ksharpes</dc:creator>
      <dc:date>2019-05-08T12:12:04Z</dc:date>
    </item>
  </channel>
</rss>

