<?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 Selecting a certain rank in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Selecting-a-certain-rank/m-p/281908#M104815</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi danielact,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think top() is not the appropriate function (top is an inter record function, not the function to deliver top 10 value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With out tryingmyself, try something like&lt;/P&gt;&lt;P&gt;= only({&amp;lt;Year= {"=rank(sum(Loss_Amount),Year) =10"}&amp;gt;} Year )&lt;/P&gt;&lt;P&gt;for #10 worst year (but not by department, right now)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you post a small example, someone in the forum might help you, almost for sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jul 2011 16:17:56 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-07-14T16:17:56Z</dc:date>
    <item>
      <title>Selecting a certain rank</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-certain-rank/m-p/281907#M104814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my dataset, let's assume I have a table with teh following fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Department&lt;/P&gt;&lt;P&gt;Year&lt;/P&gt;&lt;P&gt;Loss_#&lt;/P&gt;&lt;P&gt;Loss_Amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each year, there can be any number of losses. Let's say there are 100 years of data. I want to see, by department, the 10th worst year.&lt;/P&gt;&lt;P&gt;I thought this would work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;top(aggr(sum(Loss_Amount),Year),10)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason, unless I put year as my dimension, it won't work - it comes up blank. Not only that, if I put in only year as the dimension and then put in this as an expression:&lt;/P&gt;&lt;P&gt;rank(aggr(sum(Loss_Amount),Year))&lt;/P&gt;&lt;P&gt;I'm getting values over 100. Shouldn't the highest value be 100?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately, I want to see the 10th worst year's total losses by department. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 15:45:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-certain-rank/m-p/281907#M104814</guid>
      <dc:creator>danielact</dc:creator>
      <dc:date>2011-07-14T15:45:14Z</dc:date>
    </item>
    <item>
      <title>Selecting a certain rank</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-certain-rank/m-p/281908#M104815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi danielact,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think top() is not the appropriate function (top is an inter record function, not the function to deliver top 10 value).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With out tryingmyself, try something like&lt;/P&gt;&lt;P&gt;= only({&amp;lt;Year= {"=rank(sum(Loss_Amount),Year) =10"}&amp;gt;} Year )&lt;/P&gt;&lt;P&gt;for #10 worst year (but not by department, right now)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you post a small example, someone in the forum might help you, almost for sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jul 2011 16:17:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-certain-rank/m-p/281908#M104815</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-14T16:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting a certain rank</title>
      <link>https://community.qlik.com/t5/QlikView/Selecting-a-certain-rank/m-p/281909#M104816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Danielact,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I played a little bit around, maybe I have found a solution. Please have a look at attached qvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression uses firstsortedvalue to get the the Xth worst year per department and shows corresponding&amp;nbsp; Loss_Amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this something you had in mind?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jul 2011 00:01:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Selecting-a-certain-rank/m-p/281909#M104816</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-15T00:01:29Z</dc:date>
    </item>
  </channel>
</rss>

