<?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 Re: QlikView Experts: Control Chart Challenge in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560767#M1123301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is possible in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you set 2 more expressions as counters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;R2CUMA_revCT: how many rows above untill the next time there is a run of 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(below([R2CUMA_revCT])),0,&lt;/P&gt;&lt;P&gt;if([R2CUMA]=-8,0,below([R2CUMA_revCT])+1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;R2CUMA_abvCT: how many rows below until the next time there is a run of 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(above([R2CUMA_abvCT])),0,&lt;/P&gt;&lt;P&gt;if([R2CUMA]=-8,0,above([R2CUMA_abvCT])+1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use these in a rangesum calculation to get the average for "R2CUMA_revCT" rows below and "R2CUMA_abvCT" rows above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Average2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=rangesum(above(Data,-R2CUMA_revCT,R2CUMA_revCT+R2CUMA_abvCT))&lt;/P&gt;&lt;P&gt;/RangeCount(above(Data,-R2CUMA_revCT,R2CUMA_revCT+R2CUMA_abvCT))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example attached. NB: the shift is barely detectable, but still there!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not quite there yet, but something to work from!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jan 2014 23:10:30 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-01-09T23:10:30Z</dc:date>
    <item>
      <title>QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560758#M1123292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Control Chart Challenge&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are a QlikView whizz it would be great to see if you can solve this particularly interesting challenge and how you go about. Good Luck!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Control Charts are used extensively in health care and the creation of these including highlighting rules has been nicely outlined by Erica in her blog (&lt;A href="http://qlikfit.blogspot.co.uk/"&gt;http://qlikfit.blogspot.co.uk/&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The interesting challenge we are currently facing is re calculating the average when there are 8 consecutive points above (or below) the average. Once this rule has been meet the average from the 9&lt;SUP&gt;th&lt;/SUP&gt; point onwards needs to be re calculated to be based only on the data points going forward. This then needs to be taken further to check again for another 8 points above or below the new average, and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have spent countless hours trying to solve this and got nowhere!!!!!!!!!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find attached:&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;‘Data Average Changes.xlsx’: Data and an image illustrating the step up in average we need to create&lt;/LI&gt;&lt;LI&gt;‘Control Chart Template - Jumping Average.qvw’ : Example QlikView application with the data and&amp;nbsp; a control chart that could be used as a starting point. &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I look forward to seeing your solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 05:55:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560758#M1123292</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-07T05:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560759#M1123293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interesting challenge! I suspect this might be something best tackled in the script, will have a look later on tonight &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 11:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560759#M1123293</guid>
      <dc:creator />
      <dc:date>2014-01-08T11:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560760#M1123294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also looked into the document and indeed very interesting challenge but i'm a bit confused about the correct/wanted result.&lt;/P&gt;&lt;P&gt;Could you repost the Excel after you added a collumn with the correct/wanted average per line ? So I can see where it changes and how it is calculated. &lt;/P&gt;&lt;P&gt;Most of the time a Excel with the correct data brings 50% of the sollution to these 'challenges'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 11:49:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560760#M1123294</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-08T11:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560761#M1123295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the interest in the challange.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a new Excel document with some of the working, note in this example i am only checking for points above the line however if we can resolve the issue for points above the line we will be able to also apply it to points below the line. Please also note a lot of this is done manually in my example eg having to identify the 9th point and then restarting the running average in a new column. Hopefully this is clearer as to desired outcomes. Just let me know if there is anything else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that we need to be comparing each data point to a RUNNING average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2014 19:25:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560761#M1123295</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-08T19:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560762#M1123296</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 think the Excel-solution is not far away.&lt;/P&gt;&lt;P&gt;Attached is a Excel with the same results as you gave me but I still have to copy 2 columns and manualy activate the formula.&lt;/P&gt;&lt;P&gt;I don't think it is a good moment to look into the Excel, but I would ask you if you could give me a new list of data (only Date + Data is OK, no chart, no correct figures) and I will use the formules to predict the results. After that it will be up to you to check these and if this is OK I think we can continue to Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: I don't think it is possible to solve the challlange with formules, but will have to use the script I suppose, and that could slow down the load. Are we talking about great number of records ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS2 : Erica if you find the solution first, please do NOT say it was easy, it would ruin my week&amp;nbsp; &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 00:10:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560762#M1123296</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-09T00:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560763#M1123297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is definitely another step closer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached another spreadsheet with new data. The first tab is the same data as before however with no chart and extra columns. The second sheet i have modified the records in the data column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data sets will not be large so load times should not be an issue. My only concern with doing this in the script is that the chart will not be dynamic for example if we wanted to filter for a particular year or region. However if we can do it in the script that is still better than manually in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 00:48:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560763#M1123297</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-09T00:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560764#M1123298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Erica, i look forward to seeing how you go.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 00:48:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560764#M1123298</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-09T00:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560765#M1123299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a solution in script, I think, using some random data, but it proves the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;// Sample Data - row order will need to be accurate to ensure correct calculation later&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Data1:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Rowno&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &amp;amp; ':' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;amp; ':' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;UID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;* &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;inline&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt;ID, Value&lt;BR /&gt;1, 85 &lt;BR /&gt;2, 74&lt;BR /&gt;3, 83&lt;BR /&gt;4, 62&lt;BR /&gt;5, 81&lt;BR /&gt;6, 80&lt;BR /&gt;7, 79&lt;BR /&gt;8, 78&lt;BR /&gt;9, 77&lt;BR /&gt;10, 86&lt;BR /&gt;11, 85&lt;BR /&gt;12, 86&lt;BR /&gt;13, 88&lt;BR /&gt;14, 89&lt;BR /&gt;15, 90&lt;BR /&gt;16, 91&lt;BR /&gt;17, 91&lt;BR /&gt;18, 92&lt;BR /&gt;19, 86&lt;BR /&gt;20, 88&lt;BR /&gt;21, 98&lt;BR /&gt;22, 97&lt;BR /&gt;23, 98&lt;BR /&gt;24, 97]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;SeedSample&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 3; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//specify how many rows to sample to start off average&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;RunPeriod&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 8; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//specify how many consecutive periods should trigger a change&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;FirstAvg:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SeedAvg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; Data1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;RecNo&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &amp;lt;= &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(SeedSample)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;Seed&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('SeedAvg');&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Drop&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Table&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; FirstAvg;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;runningAvg&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;runningSum&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgSequence&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;LastAvg&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;seq&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgRun&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//Loop over each row&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;for&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;r&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;NoOfRows&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('Data1')&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;runningAvgPrev&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;runningAvg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;runningSum&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = (&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;runningSum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; + &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SubField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FieldValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('UID',&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(r)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;),':',3));&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;runningAvg&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;runningSum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; / &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;seq&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;runningAvg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Seed&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgSequence&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;else&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgSequence&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = -1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;end&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgSequencePrev&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgSequence&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgRun&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgRun&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; + 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;ELSE&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgRun&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;end&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgSequencePrev&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgSequence&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgRun&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(RunPeriod)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;seq&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;runningSum&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SubField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FieldValue&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;('UID',&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(r)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;),':',3);&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;runningAvg&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;runningAvgPrev&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;Seed&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;runningAvg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;AvgRun&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;end&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;let&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;seq&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;seq&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; + 1;&lt;BR /&gt;&lt;BR /&gt;RunningAvgs:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(r)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(runningSum)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RunningSum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(runningAvg)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;RunningAvg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(AvgSequence)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgSequence&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(AvgRun)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgRun&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(Seed)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ActiveAvg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;autogenerate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;next&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;r&lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try copying it into a new doc and see how it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 09:16:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560765#M1123299</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2014-01-09T09:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560766#M1123300</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;Enclosed the new data with the Excel-formula.&lt;/P&gt;&lt;P&gt;The first set is givin same result, the second has to be checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you test flipside's solution ? I'am very curious but I have no time for the moment to test it myself.&lt;/P&gt;&lt;P&gt;Perhaps later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;flipside&lt;/STRONG&gt;, you have already my respect &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/blush.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 10:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560766#M1123300</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-09T10:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560767#M1123301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is possible in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you set 2 more expressions as counters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;R2CUMA_revCT: how many rows above untill the next time there is a run of 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(below([R2CUMA_revCT])),0,&lt;/P&gt;&lt;P&gt;if([R2CUMA]=-8,0,below([R2CUMA_revCT])+1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;R2CUMA_abvCT: how many rows below until the next time there is a run of 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(above([R2CUMA_abvCT])),0,&lt;/P&gt;&lt;P&gt;if([R2CUMA]=-8,0,above([R2CUMA_abvCT])+1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use these in a rangesum calculation to get the average for "R2CUMA_revCT" rows below and "R2CUMA_abvCT" rows above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Average2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=rangesum(above(Data,-R2CUMA_revCT,R2CUMA_revCT+R2CUMA_abvCT))&lt;/P&gt;&lt;P&gt;/RangeCount(above(Data,-R2CUMA_revCT,R2CUMA_revCT+R2CUMA_abvCT))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example attached. NB: the shift is barely detectable, but still there!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not quite there yet, but something to work from!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 23:10:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560767#M1123301</guid>
      <dc:creator />
      <dc:date>2014-01-09T23:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560768#M1123302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can easily change the counter expressions to reset when they get to points below the line, as well as above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(below([R2CUMA_revCT])),0,&lt;/P&gt;&lt;P&gt;if([R2CUMA]=-8 &lt;STRONG&gt;or [R2CUM]=-8&lt;/STRONG&gt;,0,below([R2CUMA_revCT])+1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where R2CUM is the equivalent expression that tests for points below the line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 23:45:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560768#M1123302</guid>
      <dc:creator />
      <dc:date>2014-01-09T23:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560769#M1123303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second sheet is very close to be being perfect. The only thing is that once the rule has been meet it can not be meet again until there has been at lease another 9 points. I have reattached it and highlighted in red where this rule would come into effect. I am not sure how/where we add the rule that says if the average has restarted then needs to be at least 9 points away from when it started but i think once we get it we would have automated it in excel at least.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for all your help to date&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 01:17:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560769#M1123303</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-10T01:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560770#M1123304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Flipside,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for responding. I have put your script into a QVW and input the data (see QVW attached). It seems to be re-calculating the average every 8 points (or what ever the 'runperiod' is set to). What we require to trigger a change in the average is 9 (runperiod) consecutive points above the average. I feel like your script and the concept of a loop approach is another step closer with one of the remaining piece of the puzzle for this approach is getting the step up trigger correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I look forward to seeing if we crack this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 01:26:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560770#M1123304</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-10T01:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560771#M1123305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Erica. This also sounds like it is a step closer and if we can do it in the chart that would be AMAZING!!! In your example it seems that the average is not what I would have expected though. I would have expected it to be around 91% for starters and then jump to around 94% &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;on the 01/11/13 to the end of the period. This is based on 9 consecutive points. Again i feel like the concept is there and it is just a matter of tweaking to get it right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to head to a wedding now so don't have time to fully understand the new fields sorry but I will hopefully get a chance over the weekend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 01:48:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560771#M1123305</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-10T01:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560772#M1123306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's probably because there issues with the Above function - for some reason rangecount(above(Data,0,30) is returning 17, not 30! I think it because the field is dynamic ie $(variable) rather than the field name... the counters also need to be tweaked to recognise the end of a run rather than just 8 steps into it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway enjoy your weekend, and the wedding &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&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;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 08:53:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560772#M1123306</guid>
      <dc:creator />
      <dc:date>2014-01-10T08:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560773#M1123307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try changing the line ...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgRun&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(RunPeriod)&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &lt;SPAN style="color: #800000; font-size: 8pt;"&gt;AvgRun&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(RunPeriod)&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;then &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It just depends whether you want the step up to occur ON the RunPeriod threshold or the period AFTER it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 09:25:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560773#M1123307</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2014-01-10T09:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560774#M1123308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Flipside,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have made this change and we are still having the average calculated at regular intervals instead of only when there are 9 consecutive points above the running average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think what we are missing is that every loop we need to&lt;STRONG&gt; re compare&lt;/STRONG&gt; the previous 9 'Values' to the new 'RunningAvg' to see if they are above it or not. If they are all above the new running average this would trigger a change. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again i feel like this approach is close.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Jan 2014 20:30:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560774#M1123308</guid>
      <dc:creator>danielgargiulo</dc:creator>
      <dc:date>2014-01-11T20:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560775#M1123309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you change the counters to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;R2CUMA_revCT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(below([R2CUMA_revCT])),0,&lt;/P&gt;&lt;P&gt;if(([R2CUMA]&amp;lt;=-8 and Below([R2CUMA])=0) or ([R2CUM]&amp;lt;=-8 and Below([R2CUM])=0),&lt;/P&gt;&lt;P&gt;0,&lt;/P&gt;&lt;P&gt;below([R2CUMA_revCT])+1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;R2CUMA_abvCT&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=if(isnull(above([R2CUMA_abvCT])),0,&lt;/P&gt;&lt;P&gt;if((above([R2CUMA])&amp;lt;=-8 and [R2CUMA]=0) or (above([R2CUM])&amp;lt;=-8 and [R2CUM]=0),&lt;/P&gt;&lt;P&gt;0,above([R2CUMA_abvCT])+1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then they will commence at the end of a run of 8 or more negative/ positive values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm losing the plot with the Range and above/below functions though when it comes to the average. Even just a simple expression rangecount(above(total [Data],-30,30)) is returning strange values. (it should return 30 - because that is the range that is returned by the above function...!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on that anyone?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jan 2014 23:23:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560775#M1123309</guid>
      <dc:creator />
      <dc:date>2014-01-12T23:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560776#M1123310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay - this works, but only as a temporary fix as either I don't fully under stand the above / below functions, or there maybe a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've replaced the "average 2" formula with a function which uses the below() function if it is at the start of a run (seems to work fine when offset=0) otherwise, steal the value above it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(R2CUMA_abvCT=0,&lt;/P&gt;&lt;P&gt;rangesum(below(Data,0,R2CUMA_revCT+R2CUMA_abvCT))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /(R2CUMA_revCT+R2CUMA_abvCT),&lt;/P&gt;&lt;P&gt;above([Average 2]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jan 2014 23:40:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560776#M1123310</guid>
      <dc:creator />
      <dc:date>2014-01-12T23:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: Re: QlikView Experts: Control Chart Challenge</title>
      <link>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560777#M1123311</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;Hope you are still interested in a Excel-solution because I did not follow the QlikView-solution yet ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The previous Excel was correct, but I had to copy the calculated formulas manualy to 2 columns.&lt;/P&gt;&lt;P&gt;In this new version I used the INDERECT-Excel-function (new to me) so that you only have to give columns A and B and the average will show up in column R (you can hide all the other columns).&lt;/P&gt;&lt;P&gt;I also added 9 columns to test if the data is decreasing, but I think in the current sample there is no such point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you confirm the correct results (and test other series of data) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it's OK, we have a tool to compare it with the QV-results, and I can start looking into it (but I think the others are more skilled in QV than me !!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2014 00:50:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QlikView-Experts-Control-Chart-Challenge/m-p/560777#M1123311</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-01-13T00:50:34Z</dc:date>
    </item>
  </channel>
</rss>

