<?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: Rank top five in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264948#M99569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so you want the highest ranked hospitals for each year, not the highest ranked overall.&amp;nbsp; Yes, the legend and how you want that sort of data displayed could be a problem.&amp;nbsp; I don't think we can use a calculated dimension in this case, because with that approach, a hospital is either included or not.&amp;nbsp; If you do what I suggested in my first reply (but without stacked bars), you get the correct bars for the correct amounts, but there are blanks for the missing bars and the sort order is overall, not per year.&amp;nbsp; You can take an approach like you came up with yourself, but since the hospital ranks differ by year, there's no good way to handle the legend that I can think of.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a completely different approach to displaying the information, see the attached.&amp;nbsp; I'm using a straight table with a gauge chart pretending to be the bar chart.&amp;nbsp; I use background color expressions to distinguish better between the years.&amp;nbsp; I show the year, hospital name and the # of Events next to the bar.&amp;nbsp; It's certainly not what you're asking for chart-wise, but it seems to contain the necessary information in a fairly clear format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jul 2011 19:39:10 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-07-12T19:39:10Z</dc:date>
    <item>
      <title>Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264943#M99564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to pick the top 5 values to present on a chart. I have data from 2005 through 2010 that shows a hospital name and how many events. I want to show the number of events (already summed in the data table) for the top 5 values for each year.&lt;/P&gt;&lt;P&gt;I have played around with the rank function but can't quite get it to work. Do I create an expression for each of the five using rank and setting it to a value which is from highest to fifth highest?&lt;/P&gt;&lt;P&gt;I have attached a simple example of what I have so far. right now the chart shows five hospials that&amp;nbsp; have picked. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 16:01:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264943#M99564</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2011-07-07T16:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264944#M99565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure exactly what you're after, but you could do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension 1 = Year&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension 2 = Hospital&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression&amp;nbsp; = if(rank(sum(Events))&amp;lt;=5,sum(Events))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd probably make it a stacked bar chart if that's the information you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2011 21:42:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264944#M99565</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-07T21:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264945#M99566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an updated qvw attached that shows what I am after. I used Max to find the top five hospitals for each year: "=Max(Events,1)", "=Max(Events,2)".&amp;nbsp; &lt;/P&gt;&lt;P&gt;This gets me pretty close to what I want. One of the problems with this method is if there are two hospitals that have the same value one will be skipped. For example in 2005 both hospitals 'Eight' and 'Nine' have a value of 5. Only one of these is shown in the chart, the second one is skipped and hospital 'four' with a value of 4 is displayed. Any ideas on how to fix this?&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="229" style="width: 212px; height: 218px; border-width: 1px; border-color: #000000; border-style: solid;" width="210"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Hospital&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Events&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;One&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Two&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Three&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Four&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Five&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Six&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Seven&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Eight&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2005&lt;/TD&gt;&lt;TD&gt;Nine&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;The chart should show the top 5 hospitals in this order: &lt;/P&gt;&lt;P&gt;Five /8 events&lt;/P&gt;&lt;P&gt;Three /7 events&lt;/P&gt;&lt;P&gt;Two / 6 events&lt;/P&gt;&lt;P&gt;Eight /5 events&lt;/P&gt;&lt;P&gt;Nine /5 events&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second thing I still need is to label each bar with its hospital name. How do I get the legend to display the corresponding hospital name?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 13:21:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264945#M99566</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2011-07-08T13:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264946#M99567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension 1 = Year&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Dimension 2 = =aggr(if(rank(sum(Events))&amp;lt;=5,Hospital),Hospital) // suppress nulls, sort by sum(Events) descending&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Expression&amp;nbsp; = sum(Events)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 19:33:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264946#M99567</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-08T19:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264947#M99568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works great for one year. When more years are added it has a problem. It look at which hospitals have the most events total and only shows those as the five examples. In 2006 it shows hospital Eight =4, even though hospital Six=6. I need it to calculate each year. I am guessing that the legend will be a problme with this scenario and am trying to figure out a way to remove the legend and display the hospital name on the bar instead or in addition to the event value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 20:30:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264947#M99568</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2011-07-11T20:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264948#M99569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so you want the highest ranked hospitals for each year, not the highest ranked overall.&amp;nbsp; Yes, the legend and how you want that sort of data displayed could be a problem.&amp;nbsp; I don't think we can use a calculated dimension in this case, because with that approach, a hospital is either included or not.&amp;nbsp; If you do what I suggested in my first reply (but without stacked bars), you get the correct bars for the correct amounts, but there are blanks for the missing bars and the sort order is overall, not per year.&amp;nbsp; You can take an approach like you came up with yourself, but since the hospital ranks differ by year, there's no good way to handle the legend that I can think of.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a completely different approach to displaying the information, see the attached.&amp;nbsp; I'm using a straight table with a gauge chart pretending to be the bar chart.&amp;nbsp; I use background color expressions to distinguish better between the years.&amp;nbsp; I show the year, hospital name and the # of Events next to the bar.&amp;nbsp; It's certainly not what you're asking for chart-wise, but it seems to contain the necessary information in a fairly clear format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 19:39:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264948#M99569</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-07-12T19:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264949#M99570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried doing this in a mekko chart&amp;nbsp; do you have qlikview 10.&lt;/P&gt;&lt;P&gt;something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically having and expression sort, of sum(events) descending and on the presentation tab&amp;nbsp; set max visible no&amp;nbsp; to 5 on the hospital dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updated below&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 20:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264949#M99570</guid>
      <dc:creator>shaunsomai</dc:creator>
      <dc:date>2011-07-12T20:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264950#M99571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;John - I am following your posts. And the new approach of ranking is fantastic and personally to me, this is best way to visualize the data. Thanks again for your expert suggestions.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Cheers - DV&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 08:17:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264950#M99571</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2011-07-13T08:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rank top five</title>
      <link>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264951#M99572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Your method of displaying in a straight table will work great. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dale&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 19:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rank-top-five/m-p/264951#M99572</guid>
      <dc:creator>dhborchardt</dc:creator>
      <dc:date>2011-07-13T19:26:36Z</dc:date>
    </item>
  </channel>
</rss>

