<?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: stock in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/stock/m-p/935691#M957224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not as good as sunny's solution but this is another way of doing it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;year of stock, month of stock,Price&lt;/P&gt;&lt;P&gt;2015, 1, 320000&lt;/P&gt;&lt;P&gt;2015, 2, 210000&lt;/P&gt;&lt;P&gt;2015, 3, 420000&lt;/P&gt;&lt;P&gt;2015, 4, 250000&lt;/P&gt;&lt;P&gt;2015, 5, 440000&lt;/P&gt;&lt;P&gt;2015, 6, 270000&lt;/P&gt;&lt;P&gt;2015, 7, 420000&lt;/P&gt;&lt;P&gt;2015, 8, 750000&lt;/P&gt;&lt;P&gt;2015, 9, 740000&lt;/P&gt;&lt;P&gt;2015, 10, 430000&lt;/P&gt;&lt;P&gt;2015, 11, 220000&lt;/P&gt;&lt;P&gt;2015, 12, 250000&lt;/P&gt;&lt;P&gt;2014, 1, 320000&lt;/P&gt;&lt;P&gt;2014, 2, 210000&lt;/P&gt;&lt;P&gt;2014, 3, 420000&lt;/P&gt;&lt;P&gt;2014, 4, 250000&lt;/P&gt;&lt;P&gt;2014, 5, 440000&lt;/P&gt;&lt;P&gt;2014, 6, 270000&lt;/P&gt;&lt;P&gt;2014, 7, 420000&lt;/P&gt;&lt;P&gt;2014, 8, 750000&lt;/P&gt;&lt;P&gt;2014, 9, 740000&lt;/P&gt;&lt;P&gt;2014, 10, 430000&lt;/P&gt;&lt;P&gt;2014, 11, 220000&lt;/P&gt;&lt;P&gt;2014, 12, 250000 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;1 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;2 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=2&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;3 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=3&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;4 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=4&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;5 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=5&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;6 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=6&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;7 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=7&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;8 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=8&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;9 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=9&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;10 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=10&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;11 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=11&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;sum(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;12 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]=12&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Final)&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;[month of stock],&lt;/P&gt;&lt;P&gt;Price&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Nov 2015 13:49:21 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2015-11-04T13:49:21Z</dc:date>
    <item>
      <title>stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935689#M957222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my scenario. Please suggest. I don't have any specific data so far.it is only initial stage and few trial and error checks are going on . I require this on the script not as an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my data to some extent looks like the below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basicall I need to calculate the average value. I have used an excel to calculate the average&lt;/P&gt;&lt;P&gt;so the calculation should be something like the below&lt;/P&gt;&lt;P&gt;12 price value remains as same&lt;/P&gt;&lt;P&gt;11 is average(12 and 11)&lt;/P&gt;&lt;P&gt;10 is average (12,11, and 10)&lt;/P&gt;&lt;P&gt;09 is average (12,11,10 and 09)&lt;/P&gt;&lt;P&gt;so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;secondlt the calculation should be for 2014 ,20103 until back. .so when I click on the calendar an year and month&amp;nbsp; it should reflect the average also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="498"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="18" style="border: 0px windowtext; border-image: none;" width="98"&gt;&lt;SPAN style="color: #000000;"&gt;year of stock&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px windowtext; border-image: none;" width="119"&gt;&lt;SPAN style="color: #000000;"&gt;month of stock&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px windowtext; border-image: none;" width="84"&gt;&lt;SPAN style="color: #000000;"&gt;price value&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px windowtext; border-image: none;" width="197"&gt;&lt;SPAN style="color: #000000;"&gt;average price value&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0.5pt solid #88baea; border-image: none;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;3,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: #88baea #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;3,93333&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2,10000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,00000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,19000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,18889&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;5&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;6&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2,70000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;7&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,68333&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;8&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;7,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,78000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;9&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;7,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,10000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;10&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;4,30000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;3,00000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;11&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2,35000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="18" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px windowtext; border-image: none;"&gt;&lt;SPAN style="color: #000000;"&gt;12&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri;"&gt;2,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:16:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935689#M957222</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-04T11:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935690#M957223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There might be a easier way, but may be this:&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 [year of stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [month of stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [price value], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [average price value]&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;Community_190287.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;NewTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [year of stock] as [Year of Stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [month of stock] as [Month of Stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [price value] as [Price Value], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [average price value] as [Average Price Value],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -11) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -10) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -9) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -8) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -7) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -6) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -5) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -4) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -3) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -2) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -1) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1)), [price value]))))))))))) as [Average Price Value1]&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;Order By [year of stock], [month of stock] desc;&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;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/103876_Capture.PNG" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Nov 2015 11:52:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935690#M957223</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-04T11:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935691#M957224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not as good as sunny's solution but this is another way of doing it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;year of stock, month of stock,Price&lt;/P&gt;&lt;P&gt;2015, 1, 320000&lt;/P&gt;&lt;P&gt;2015, 2, 210000&lt;/P&gt;&lt;P&gt;2015, 3, 420000&lt;/P&gt;&lt;P&gt;2015, 4, 250000&lt;/P&gt;&lt;P&gt;2015, 5, 440000&lt;/P&gt;&lt;P&gt;2015, 6, 270000&lt;/P&gt;&lt;P&gt;2015, 7, 420000&lt;/P&gt;&lt;P&gt;2015, 8, 750000&lt;/P&gt;&lt;P&gt;2015, 9, 740000&lt;/P&gt;&lt;P&gt;2015, 10, 430000&lt;/P&gt;&lt;P&gt;2015, 11, 220000&lt;/P&gt;&lt;P&gt;2015, 12, 250000&lt;/P&gt;&lt;P&gt;2014, 1, 320000&lt;/P&gt;&lt;P&gt;2014, 2, 210000&lt;/P&gt;&lt;P&gt;2014, 3, 420000&lt;/P&gt;&lt;P&gt;2014, 4, 250000&lt;/P&gt;&lt;P&gt;2014, 5, 440000&lt;/P&gt;&lt;P&gt;2014, 6, 270000&lt;/P&gt;&lt;P&gt;2014, 7, 420000&lt;/P&gt;&lt;P&gt;2014, 8, 750000&lt;/P&gt;&lt;P&gt;2014, 9, 740000&lt;/P&gt;&lt;P&gt;2014, 10, 430000&lt;/P&gt;&lt;P&gt;2014, 11, 220000&lt;/P&gt;&lt;P&gt;2014, 12, 250000 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;1 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;2 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=2&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;3 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=3&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;4 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=4&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;5 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=5&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;6 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=6&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;7 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=7&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;8 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=8&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;9 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=9&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;10 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=10&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;avg(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;11 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]&amp;gt;=11&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;sum(Price) as AvgPrice,&lt;/P&gt;&lt;P&gt;12 as [month of stock]&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;where [month of stock]=12&lt;/P&gt;&lt;P&gt;Group by [year of stock];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Final)&lt;/P&gt;&lt;P&gt;LOAD Distinct [year of stock],&lt;/P&gt;&lt;P&gt;[month of stock],&lt;/P&gt;&lt;P&gt;Price&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Nov 2015 13:49:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935691#M957224</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-11-04T13:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935692#M957225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam still testing,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you just explain me how this works for example taking one or 2 months in picture&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; If(Peek('Year of Stock', -2) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 08:58:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935692#M957225</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-05T08:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935693#M957226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;If(Peek('Year of Stock', -2) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In simple words the above is checking if hopping back two period has the same year as current row's year then &lt;STRONG&gt;RangeAvg(CurrentRow'sPrice, PreviousRow'sPrice, and Previous to PreviousRow'sPrice)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Important thing here is to have a sorting order &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Order By [year of stock], [month of stock] desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we don't sort the table correctly, you will see undesirable results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 12:54:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935693#M957226</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-05T12:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935694#M957227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is hopping back 2 period. can u specify an example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 14:49:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935694#M957227</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-05T14:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935695#M957228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="325" style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; width: 686px; height: 329px;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;" width="98"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;year of stock&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;" width="119"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;month of stock&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;" width="84"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;price value&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;" width="197"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;average price value&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;" width="197"&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Peek('Year of Stock', -2)&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;" width="197"&gt;Avg&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0.5pt solid #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;3,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: #88baea #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;3,93333&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: #88baea #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;-&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: #88baea #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;2,10000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,00000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;-&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,19000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;320000, 210000,420000&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;2,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,18889&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;210000,420000,250000&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;5&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;and so on&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;6&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;2,70000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;7&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,68333&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;8&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;7,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,78000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;9&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;7,40000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,10000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;10&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;4,30000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;3,00000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;11&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;2,20000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;2,35000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD align="right" height="18" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;2015&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px windowtext; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;12&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: black #88baea #88baea; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;2,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: Calibri; color: #000000;"&gt;2,50000&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;2015&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: black #88baea #88baea black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the way the if statement is structured, it will check backwards if the first statement is met, it will never go to the next level&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So When this is met -&amp;gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt; If(Peek('Year of Stock', -11) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11))&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Only for the last row above, you get the average for 12 rows. Next row won't meet this -&amp;gt; &lt;STRONG style="color: #3d3d3d; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;Peek('Year of Stock', -11) = [year of stock] &lt;/STRONG&gt;and will look for next possible match and will meet the condition here -&amp;gt; &lt;STRONG style="color: #3d3d3d; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;Peek('Year of Stock', -10) = [year of stock]&lt;/STRONG&gt; and so on..&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Does that make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 14:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935695#M957228</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-05T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935696#M957229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this solution will help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sampledata:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Num([year of stock]) as [year of stock],&lt;/P&gt;&lt;P&gt;&amp;nbsp; Num([month of stock]) as [month of stock],&lt;/P&gt;&lt;P&gt;&amp;nbsp; Num([price value]) as [price value]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD * inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&amp;nbsp; "year of stock", "month of stock", "price value"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "1", "3,20000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "2", "2,10000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "3", "4,20000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "4", "2,50000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "5", "4,40000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "6", "2,70000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "7", "4,20000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "8", "7,50000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "9", "7,40000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "10", "4,30000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "11", "2,20000"&lt;/P&gt;&lt;P&gt;&amp;nbsp; "2015", "12", "2,50000"&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapStock:&lt;/P&gt;&lt;P&gt;Mapping Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; [year of stock] &amp;amp; '-' &amp;amp; [month of stock] as value,&lt;/P&gt;&lt;P&gt;&amp;nbsp; [price value] as value&lt;/P&gt;&lt;P&gt;Resident Sampledata;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Averages:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; [year of stock],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [month of stock],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [price value],&lt;/P&gt;&lt;P&gt;&amp;nbsp; (alt([price month 1], 0) + alt([price month 2], 0) + alt([price month 3], 0) + alt([price month 4], 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; + alt([price month 5], 0) + alt([price month 6], 0) &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;+ alt([price month 7], 0) + alt([price month 8], 0) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; + alt([price month 9], 0) + alt([price month 10], 0) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;+ alt([price month 11], 0) + alt([price month 12], 0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; / (if(IsNull([price month 1]), 0, 1) + if(IsNull([price month 2]), 0, 1) + if(IsNull([price month 3]), 0, 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; + if(IsNull([price month 4]), 0, 1) + if(IsNull([price month 5]), 0, 1) + if(IsNull([price month 6]), 0, 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; + if(IsNull([price month 7]), 0, 1) + if(IsNull([price month 8]), 0, 1) + if(IsNull([price month 9]), 0, 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; + if(IsNull([price month 10]), 0, 1) + if(IsNull([price month 11]), 0, 1) + if(IsNull([price month 12]), 0, 1))&lt;/P&gt;&lt;P&gt;&amp;nbsp; as [average price value]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; [year of stock],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [month of stock],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [price value],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 1, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 1, Null()), Null()) as [price month 1],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 2, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 2, Null()), Null()) as [price month 2],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 3, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 3, Null()), Null()) as [price month 3],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 4, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 4, Null()), Null()) as [price month 4],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 5, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 5, Null()), Null()) as [price month 5],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 6, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 6, Null()), Null()) as [price month 6],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 7, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 7, Null()), Null()) as [price month 7],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 8, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 8, Null()), Null()) as [price month 8],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 9, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 9, Null()), Null()) as [price month 9],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 10, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 10, Null()), Null()) as [price month 10],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 11, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 11, Null()), Null()) as [price month 11],&lt;/P&gt;&lt;P&gt;&amp;nbsp; if([month of stock] &amp;lt;= 12, ApplyMap('MapStock', [year of stock] &amp;amp; '-' &amp;amp; 12, Null()), Null()) as [price month 12]&lt;/P&gt;&lt;P&gt;Resident Sampledata;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Sampledata;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 15:43:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935696#M957229</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-05T15:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935697#M957230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one more problem I have 13 th and 14th month&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 16:37:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935697#M957230</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-05T16:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935698#M957231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a year you have 13th and 14th month?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 16:38:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935698#M957231</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-05T16:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935699#M957232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunny,&lt;/P&gt;&lt;P&gt;this is an financial arrangement ..some companies can have until 18th month.. for many adjustments&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 07:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935699#M957232</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-06T07:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935700#M957233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For 18 months (year being still the same) you can try this code:&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 [year of stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [month of stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [price value], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [average price value]&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;Community_190287.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;NewTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD [year of stock] as [Year of Stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [month of stock] as [Month of Stock], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [price value] as [Price Value], &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [average price value] as [Average Price Value],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -17) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11), Peek('Price Value', -12),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -13), Peek('Price Value', -14), Peek('Price Value', -15), Peek('Price Value', -16),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -17)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -16) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11), Peek('Price Value', -12),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -13), Peek('Price Value', -14), Peek('Price Value', -15), Peek('Price Value', -16)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -15) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11), Peek('Price Value', -12),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -13), Peek('Price Value', -14), Peek('Price Value', -15)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -14) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11), Peek('Price Value', -12),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -13), Peek('Price Value', -14)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -13) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11), Peek('Price Value', -12),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -13)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -12) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11), Peek('Price Value', -12)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -11) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10), Peek('Price Value', -11)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -10) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9), Peek('Price Value', -10)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -9) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -9)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -8) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7), Peek('Price Value', -8)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -7) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6), Peek('Price Value', -7)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -6) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5), Peek('Price Value', -6)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -5) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Peek('Price Value', -5)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -4) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3), Peek('Price Value', -4)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -3) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2), Peek('Price Value', -3)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -2) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -1) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1)), [price value]))))))))))))))))) as [Average Price Value1]&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;Order By [year of stock], [month of stock] desc;&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;If year can change, please provide a representative sample of how your data might look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 09:01:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935700#M957233</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-06T09:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935701#M957234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks good now. I need a small change here. the calculation should be reversed..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that means&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st month - the same value&lt;/P&gt;&lt;P&gt;2nd month - avg of 1 and 2&lt;/P&gt;&lt;P&gt;3rd - avg of 1,2,3&lt;/P&gt;&lt;P&gt;4th ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but certain calculations I feel its not taking average. or I am wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 08:48:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935701#M957234</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-13T08:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935702#M957235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you see any place where they are wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reversing the order of Avg, you can remove the &lt;STRONG&gt;desc &lt;/STRONG&gt;from the Order By Statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;If(Peek('Year of Stock', -2) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1), Peek('Price Value', -2)),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Peek('Year of Stock', -1) = [year of stock],&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RangeAvg([price value], Peek('Price Value', -1)), [price value]))))))))))))))))) as [Average Price Value1]&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Order By [year of stock], [month of stock] &lt;SPAN style="text-decoration: line-through;"&gt;&lt;SPAN style="color: #ff0000; text-decoration: line-through;"&gt;desc&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 11:28:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935702#M957235</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-13T11:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935703#M957236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam trying ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is their another way to write this script witout using order by clause as iam trying to insert these lines between one long existing code ..just for the sake to get this additional column ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:21:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935703#M957236</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-13T12:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935704#M957237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can u provide me the script similar for reverse..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935704#M957237</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-13T12:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935705#M957238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did in my previous post. Did you look at the attachment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:45:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935705#M957238</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-13T12:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935706#M957239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want to touch the script, why don't you do it on the front end of the application? You can get a much more simpler expression if you do this on the front end of the application.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 12:46:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935706#M957239</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-13T12:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935707#M957240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically iam facing 2 issues ..your script results is good from calculating from the desc..without using order by clause&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I use order by clause iam getting undesired results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so I was asking you the script similar one to calculate ascending without using the order by options only for 12 months.. 18 months is no more required..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you let me know from the front end also? I prefer this is as last option ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935707#M957240</guid>
      <dc:creator>raadwiptec</dc:creator>
      <dc:date>2015-11-13T13:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: stock</title>
      <link>https://community.qlik.com/t5/QlikView/stock/m-p/935708#M957241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, it won't work without the order by. At least as per my knowledge, and I would love to be proven wrong. Front end expression would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(Sum([Price Value]) &amp;gt; 0, RangeAvg(Above(Sum({&amp;lt;[Month of Stock] = &amp;gt;}[Price Value]), 0, RowNo())))&lt;/STRONG&gt;&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/105433_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 13:29:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/stock/m-p/935708#M957241</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-13T13:29:16Z</dc:date>
    </item>
  </channel>
</rss>

