<?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 Top 10% function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253443#M1206348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In an expression, "AVG" gives me the average of the filed values defined by the expression across all the records selected. I don't want the average, I want the average of the maximum 10%. How do I get this? For example, if the records consist of name and weight, the "AVG" function gives me the average of all the weights for the records selected. How do I get the average weight of the 10% of the selected records that hre the heaviest?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Apr 2010 23:43:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-22T23:43:34Z</dc:date>
    <item>
      <title>Top 10% function</title>
      <link>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253443#M1206348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In an expression, "AVG" gives me the average of the filed values defined by the expression across all the records selected. I don't want the average, I want the average of the maximum 10%. How do I get this? For example, if the records consist of name and weight, the "AVG" function gives me the average of all the weights for the records selected. How do I get the average weight of the 10% of the selected records that hre the heaviest?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 23:43:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253443#M1206348</guid>
      <dc:creator />
      <dc:date>2010-04-22T23:43:34Z</dc:date>
    </item>
    <item>
      <title>Top 10% function</title>
      <link>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253444#M1206349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Untested, but something like this?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;avg(&amp;lt;{Weight*={"&amp;gt;=$(=fractile(Weight,.9))"}&amp;gt;} Weight)&lt;/P&gt;&lt;P&gt;The fractile(Weight,.9) should find a Weight where 90% of your selected records are lighter, and 10% are heavier. We use that inside a search expression, "&amp;gt;=...". The search expression is then applied to the Weight column using set analysis to find ALL Weights equal to or greater than that Weight. But not all of those are necessarily selected, and we only want the selected Weights, so we intersect that set with our selections using *=. Finally, we take the average Weight of the results. Sounds right in my brain. Not sure if I have all the syntactic details correct, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 00:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253444#M1206349</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-23T00:26:21Z</dc:date>
    </item>
    <item>
      <title>Top 10% function</title>
      <link>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253445#M1206350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John, not only for the code but especially for taking time to pass along your thought process and the explanation.&lt;/P&gt;&lt;P&gt;Will this still work if the variable "weight" in the expression is replaced with another expression using several variables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 00:44:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253445#M1206350</guid>
      <dc:creator />
      <dc:date>2010-04-23T00:44:20Z</dc:date>
    </item>
    <item>
      <title>Top 10% function</title>
      <link>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253446#M1206351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately no, not as a mere substitution, anyway. You can only use set analysis on fields, not on expressions, I believe. It doesn't mean all is lost; it just means that we may have to rearrange some things. Let me know what you're &lt;EM&gt;really&lt;/EM&gt; trying to do, and maybe I can figure it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 00:51:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253446#M1206351</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-23T00:51:16Z</dc:date>
    </item>
    <item>
      <title>Top 10% function</title>
      <link>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253447#M1206352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not to wear out my welcome, but I can't see the problem here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg({$&amp;lt;[Provider-Name]=&amp;gt;},{$&amp;lt;[[Provider-Id]]=&amp;gt;} ,&lt;/P&gt;&lt;P&gt;(&amp;lt;{time to bill*={"&amp;gt;=$(=fractile(time to bill,.9))"}&amp;gt;} time to bill))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In calculating this expression, I want to ignore any selections on the variables [Provider Name] and [Provider Id]; I want the average of the field [time to bill] for the top 10% of the of the records with the highest [time to bill]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't know what happened to my font - sorry&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 01:09:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253447#M1206352</guid>
      <dc:creator />
      <dc:date>2010-04-23T01:09:15Z</dc:date>
    </item>
    <item>
      <title>Top 10% function</title>
      <link>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253448#M1206353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax problems. I think you want this, but it's getting complicated enough that I'm unlikely to be entirely correct.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;avg({&amp;lt;[Provider-Name]=,[Provider-Id]=,[time to bill]*={"&amp;gt;=$(=fractile({&amp;lt;[Provider-Name]=,[Provider-Id]=}&amp;gt;} [time to bill],.9))"}&amp;gt;} [time to bill])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 18:10:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Top-10-function/m-p/253448#M1206353</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-04-23T18:10:33Z</dc:date>
    </item>
  </channel>
</rss>

