<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Rolling worse Minimum average in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-worse-Minimum-average/m-p/90892#M509340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a tricky problem which is quite easy in Excel but I am struggling to find a solution within QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of dates and Values for which on a line by line basis I need to calculate the average of the minimum 33 values below that line.&amp;nbsp; When that total changes show that diff.&amp;nbsp; For my final table I only need to show the lines where there is a diff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have mocked up a spreadsheet (attached)&amp;nbsp; which has two different methodologies.&amp;nbsp; One uses an average of Small(column F) and one uses a sumIF (column E) used in conjunction with column D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QV.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/212552_QV.JPG" style="height: 111px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I almost get the answer using the below expression but the issue with that is once you go past the first rank &amp;lt;33 technically you should be then looking for the worse 34 ranks and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangeavg(Below(Avg({&amp;lt;Rank={"&amp;lt;=33"}&amp;gt;}[Value]),0,300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have explored using this formula to use the [RevisesRank] as part of the calculation or combinations of aggr but can't get either to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any incite that can be provided would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Ross&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Sep 2018 08:02:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-09-04T08:02:08Z</dc:date>
    <item>
      <title>Rolling worse Minimum average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-worse-Minimum-average/m-p/90892#M509340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a tricky problem which is quite easy in Excel but I am struggling to find a solution within QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a list of dates and Values for which on a line by line basis I need to calculate the average of the minimum 33 values below that line.&amp;nbsp; When that total changes show that diff.&amp;nbsp; For my final table I only need to show the lines where there is a diff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have mocked up a spreadsheet (attached)&amp;nbsp; which has two different methodologies.&amp;nbsp; One uses an average of Small(column F) and one uses a sumIF (column E) used in conjunction with column D.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QV.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/212552_QV.JPG" style="height: 111px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I almost get the answer using the below expression but the issue with that is once you go past the first rank &amp;lt;33 technically you should be then looking for the worse 34 ranks and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangeavg(Below(Avg({&amp;lt;Rank={"&amp;lt;=33"}&amp;gt;}[Value]),0,300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have explored using this formula to use the [RevisesRank] as part of the calculation or combinations of aggr but can't get either to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any incite that can be provided would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Ross&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2018 08:02:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-worse-Minimum-average/m-p/90892#M509340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-04T08:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling worse Minimum average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-worse-Minimum-average/m-p/90893#M509341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was just thinking about the problem from a SQL perspective and this is the SQL solution I would use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT A.Date, A.Value, A.Rank, A.RevisedRank, (SELECT Avg(Value) AS AvgOfValue FROM Test B WHERE B.Rank&amp;lt;=A.RevisedRank AND B.Date&amp;gt;= A.Date) As RollingAve&lt;/P&gt;&lt;P&gt;FROM Test AS A;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2018 09:45:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-worse-Minimum-average/m-p/90893#M509341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-04T09:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling worse Minimum average</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-worse-Minimum-average/m-p/90894#M509342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't find a more elegant solution so I went back to my SQL days...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there will only every be 260 rows I loop through each row of the data create a temp table with the below 33 minimum value and then take an average of those 33 records.&amp;nbsp; This is then aggregated into another table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2018 15:41:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-worse-Minimum-average/m-p/90894#M509342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-09-12T15:41:12Z</dc:date>
    </item>
  </channel>
</rss>

