<?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/bottom 5 rows in script depending on variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-top-bottom-5-rows-in-script-depending-on-variable/m-p/702057#M473686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The simplest would be to&lt;/P&gt;&lt;P&gt;1 - Order your by KtM, by Travel Time ascending to obtain the appropriate sequence&lt;/P&gt;&lt;P&gt;2 - tag your routes with an index that restarts for every KtM&lt;/P&gt;&lt;P&gt;3 - store the table&lt;/P&gt;&lt;P&gt;4 - load the table for all indices that are &amp;lt; = 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antoine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Oct 2014 14:21:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-10-27T14:21:45Z</dc:date>
    <item>
      <title>Select top/bottom 5 rows in script depending on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-bottom-5-rows-in-script-depending-on-variable/m-p/702056#M473685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a file containing thousands of records that can be ordered following a given '% Key to MOAR' (KtM). Per individual KtM, there are still possibly hundreds of records/lines possible.&lt;/P&gt;&lt;P&gt;I would like to cleanup the original file, and make sure that I end up per KtM with a maximum of 5 records/lines, based upon another variable in the set I created, being UniqueKey. Only the 5 lines that have the lowest(fastest) travel time should be selected per KtM. This is the first value in the UniqueKey variable. (notice in the example I need the UniqueKey measure for the top 5, as there is more than 1 train running in the same time between the selected KtM) I managed to create a variable that indicates how many lines per KtM need to be selected, as not all KtM have 5 lines (some have less, and they should then all be taken into account). The Traveltime variable is changing for every KtM, so working with a fixed number is impossible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone show me possible routes to a solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 13:00:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-bottom-5-rows-in-script-depending-on-variable/m-p/702056#M473685</guid>
      <dc:creator>puttemans</dc:creator>
      <dc:date>2014-10-27T13:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select top/bottom 5 rows in script depending on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-bottom-5-rows-in-script-depending-on-variable/m-p/702057#M473686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Johan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The simplest would be to&lt;/P&gt;&lt;P&gt;1 - Order your by KtM, by Travel Time ascending to obtain the appropriate sequence&lt;/P&gt;&lt;P&gt;2 - tag your routes with an index that restarts for every KtM&lt;/P&gt;&lt;P&gt;3 - store the table&lt;/P&gt;&lt;P&gt;4 - load the table for all indices that are &amp;lt; = 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Antoine&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 14:21:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-bottom-5-rows-in-script-depending-on-variable/m-p/702057#M473686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-27T14:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select top/bottom 5 rows in script depending on variable</title>
      <link>https://community.qlik.com/t5/QlikView/Select-top-bottom-5-rows-in-script-depending-on-variable/m-p/702058#M473687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Antoine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help. You made me round that hurdle already &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;, some more challenges to go...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 14:52:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-top-bottom-5-rows-in-script-depending-on-variable/m-p/702058#M473687</guid>
      <dc:creator>puttemans</dc:creator>
      <dc:date>2014-10-27T14:52:16Z</dc:date>
    </item>
  </channel>
</rss>

