<?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: rangeavg or set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287182#M461667</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happy Holidays Sunny &amp;amp; Oleg! &lt;/P&gt;&lt;P&gt;Works like a charm Sunny...&lt;/P&gt;&lt;P&gt;Sunny, I also liked your approach below but didnt try it.&amp;nbsp; &lt;/P&gt;&lt;P&gt;It seems to work around the QV functions but probably boat loads faster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Dec 2016 15:43:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-12-22T15:43:20Z</dc:date>
    <item>
      <title>rangeavg or set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287177#M461662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi - &lt;/P&gt;&lt;P&gt;I have some data in this form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;id&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;fixture&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;result&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Jan-1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;lamp&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Jan-1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;lamp&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Jan-1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;table&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Mar-6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;lamp&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Mar-6&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;lamp&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Mar-9&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;table&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Mar-9&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;table&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am plotting on a line chart fixture latest averages of min values by date.&amp;nbsp; So, here on Jan-1 the MIN(A) is 4 and Mar-6 MIN(A) is 7. Since the latest two results across the lamp happen to correspond to 4 and 7, I would like to display the average 5.5 for this dimension.&amp;nbsp; It is average across the latest 4 samples in my data set, I've shown only a small portion of the data.&amp;nbsp; I do not have date as a dimension because I am showing this summary per fixture in a line chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to keep fixture as a dimension and then to use avg(aggr(min(result), date, id)) but avg iterates over the entire data set instead over the last 4 records.&amp;nbsp; In the table chart I played with the accumulation but with no success, probably because I don't have a date as a DIM. Same issue when I try to use rangeavg(below()). Can someone lend a hand, maybe some set analysis to restrict my average to the top 4 dates?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2016 23:30:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287177#M461662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-19T23:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: rangeavg or set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287178#M461663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try something like this (writing from memory, so verify the syntax):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;avg(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rangemin(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; above(min(result), 4)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , date, id)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;The Above() function with 4 should give you the last 4 entries, and the rangemin should get the minimum of the 4, and the rest is similar to your own calculation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Oleg Troyansky&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Upgrade your Qlik skills at the &lt;A href="http://masterssummit.com/"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Munich, Germany!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 00:06:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287178#M461663</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2016-12-20T00:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: rangeavg or set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287179#M461664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=FirstSortedValue(Aggr(If(date*10000 + result &amp;gt;= Max(Total &amp;lt;fixture&amp;gt; date*10000 + result, 4), result), fixture, date, result), Aggr(date*10000 + result, fixture, date, result))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 03:38:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287179#M461664</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-20T03:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: rangeavg or set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287180#M461665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Oleg! &lt;/P&gt;&lt;P&gt;You have a great memory, the syntax was right on.&lt;/P&gt;&lt;P&gt;However, I was not able to quite get the result I was after. &lt;/P&gt;&lt;P&gt;I'm attaching a sample file, I would appreciate it if you can take a peek?&lt;/P&gt;&lt;P&gt;I've attached both a sample app and data for your consideration.&lt;/P&gt;&lt;P&gt;Once I remove the date from my dimension, things start to fall apart (&amp;amp; it kind of makes sense).&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 00:18:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287180#M461665</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-22T00:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: rangeavg or set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287181#M461666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(DISTINCT Aggr(avg(aggr(NODISTINCT rangeavg(below(min(price), 0, 4) ), date)), date, rep, product, level), -Aggr(date, date, rep, product, level))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 02:01:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287181#M461666</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-22T02:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: rangeavg or set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287182#M461667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happy Holidays Sunny &amp;amp; Oleg! &lt;/P&gt;&lt;P&gt;Works like a charm Sunny...&lt;/P&gt;&lt;P&gt;Sunny, I also liked your approach below but didnt try it.&amp;nbsp; &lt;/P&gt;&lt;P&gt;It seems to work around the QV functions but probably boat loads faster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2016 15:43:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rangeavg-or-set-analysis/m-p/1287182#M461667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-22T15:43:20Z</dc:date>
    </item>
  </channel>
</rss>

