<?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: Select top N in dimension in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625771#M681406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dimension limits should work but you need to make sure you set your sort options correctly. If you only want to order by Score and everything else to be random you need to remove the sort from all other fields. Please see the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Mar 2014 16:45:03 GMT</pubDate>
    <dc:creator>iktrayanov</dc:creator>
    <dc:date>2014-03-26T16:45:03Z</dc:date>
    <item>
      <title>Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625765#M681400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Qlikview community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="174" style="border: 1px solid #000000; width: 789px; height: 174px;" width="787"&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;Year&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Company&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Posting&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Line item&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;Score&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&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;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&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;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&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;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&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;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&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;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table contains million of lines. The goal is to only show the top N records, with the table sorted on score descending. Please note that the score column contains not only distinct values. Say that&amp;nbsp; 500 records have the highest score of 5 and i want to show top 100, then it should show random 100 from those 500. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i would be able to have this result using the following query: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select top 100 * from table order by Score descending. However, i would preferably not create another table for this table chart and limit the results using dimension expressions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried solutions like this one: &lt;A href="http://qv-bitz-and-pieces.blogspot.be/2013/03/top-n-records-in-qlikview-straightpivot.html" title="http://qv-bitz-and-pieces.blogspot.be/2013/03/top-n-records-in-qlikview-straightpivot.html"&gt;Qlikview Bitz and Pieces: Top N in Qlikview Straight/Pivot Tables and Charts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;using a combination of &lt;SPAN style="color: #ffffff; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; background-color: #141414;"&gt;aggr( ), rank() and sum() &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and using the dimention limits to show first 100 values for the score dimention, but i never to shows me only 100 results. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody point me in the correct direction?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:00:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625765#M681400</guid>
      <dc:creator />
      <dc:date>2014-03-26T16:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625766#M681401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can use Dimensions Limite (in Chart properties).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Aurélien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:06:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625766#M681401</guid>
      <dc:creator>Aurelien_Martinez</dc:creator>
      <dc:date>2014-03-26T16:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625767#M681402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried using dimension limits... i select both largest or first 10 values, but i does not show top 10 records. I think this option would work i have had scores from e.g. 1 to 100 and no duplicate scores exist. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:21:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625767#M681402</guid>
      <dc:creator />
      <dc:date>2014-03-26T16:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625768#M681403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Do you want to post an example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to be sure, you are using a Straight Table, not a Table Box?&amp;nbsp; You can't limit a Table Box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually the dimension limitations option will work fine for a Straight Table (see attached).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:22:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625768#M681403</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2014-03-26T16:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625769#M681404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="top N.PNG.png" class="jive-image" src="/legacyfs/online/55938_top N.PNG.png" style="width: 620px; height: 339px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, it does not limit the records to the top/ first 10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625769#M681404</guid>
      <dc:creator />
      <dc:date>2014-03-26T16:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625770#M681405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's because you have a 1 on all your lines. You can use demension limits on the field DTT_GL_Document_Number .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625770#M681405</guid>
      <dc:creator>Aurelien_Martinez</dc:creator>
      <dc:date>2014-03-26T16:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625771#M681406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dimension limits should work but you need to make sure you set your sort options correctly. If you only want to order by Score and everything else to be random you need to remove the sort from all other fields. Please see the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625771#M681406</guid>
      <dc:creator>iktrayanov</dc:creator>
      <dc:date>2014-03-26T16:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625772#M681407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stijn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is that the DTT_Total_score field has the same value for more than 100 items, if you put the limit will work in another field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:48:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625772#M681407</guid>
      <dc:creator />
      <dc:date>2014-03-26T16:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625773#M681408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the replies. I more or less understood already that the problem was the there are no distinct values in the score column. However, none of my columns have distinct values.. only the combination of year, company code, document and line item makes the row unique. How can i include this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:51:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625773#M681408</guid>
      <dc:creator />
      <dc:date>2014-03-26T16:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625774#M681409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All i actually really need is exactly the result of this query appearing in the table: &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: 12px;"&gt;select top 100 * from table order by Score descending&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625774#M681409</guid>
      <dc:creator />
      <dc:date>2014-03-26T16:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625775#M681410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort by value descending and disable interactive sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the Presentation tab, select "Max Number (1-100)" and specify 100 as the value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 17:00:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625775#M681410</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2014-03-26T17:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625776#M681411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally, thankkkss &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;!&amp;nbsp; It works! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can i have a side-question &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/silly.png" /&gt;? &lt;/P&gt;&lt;P&gt;suppose i want to create this table in the script,&amp;nbsp; from a table that is already loaded from qvd, What would be the syntax for it? since i create it from a already loaded table i guess i need to use load resident statement, is there anything equivalent to the sql syntax, like: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table: &lt;/P&gt;&lt;P&gt;load top 100 * &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;resident loaded_table &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;order by Score descending&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 17:07:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625776#M681411</guid>
      <dc:creator />
      <dc:date>2014-03-26T17:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select top N in dimension</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625777#M681412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use FIRST:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First 100&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;Resident MyTable&lt;/P&gt;&lt;P&gt;Order by x, y;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stephen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 17:47:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-N-in-dimension/m-p/625777#M681412</guid>
      <dc:creator>stephencredmond</dc:creator>
      <dc:date>2014-03-26T17:47:27Z</dc:date>
    </item>
  </channel>
</rss>

