<?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: Using Row Number and Partition by to sort records in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55582#M9232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here with a slight adjustment by using mapping (within an additionally step) instead of joining:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;load *, week(Wait_Date) as Week, week(Wait_Date) * 10 + weekday(Wait_Date) as WeekFilter;&lt;/P&gt;&lt;P&gt;load date(date#(Wait_Date, 'DD/MM/YYYY')) as Wait_Date Inline [&lt;/P&gt;&lt;P&gt;Wait_Date&lt;/P&gt;&lt;P&gt;03/05/2018&lt;/P&gt;&lt;P&gt;15/05/2018&lt;/P&gt;&lt;P&gt;16/05/2018&lt;/P&gt;&lt;P&gt;17/05/2018&lt;/P&gt;&lt;P&gt;11/05/2018&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map:&lt;/P&gt;&lt;P&gt;mapping load Week, max(WeekFilter) as MaxWeekDate resident table group by Week;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final:&lt;/P&gt;&lt;P&gt;noconcatenate load * resident table where applymap('map', Week, 0) = WeekFilter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 19 May 2018 09:49:08 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2018-05-19T09:49:08Z</dc:date>
    <item>
      <title>Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55575#M9225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am reading in data from a qvd and I would only like to read in the data where the Wait_Date is the closest to the sunday of that current week and ignore all other dates within that same week - as there may be multiple Wait_Date within a week.&amp;nbsp; Week is Mon - Sunday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Wait_Date&lt;/P&gt;&lt;P&gt;03/05/2018&lt;/P&gt;&lt;P&gt;06/05/2018 - correct date to read in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;07/05/2018&lt;/P&gt;&lt;P&gt;09/05/2018&lt;/P&gt;&lt;P&gt;11/05/2018 - correct date to read in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help greatly appreciated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 12:20:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55575#M9225</guid>
      <dc:creator>lisab80</dc:creator>
      <dc:date>2018-05-18T12:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55576#M9226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;I would :&lt;/P&gt;&lt;P&gt;1 - load the data and for each day calculate the difference in days between this day and the sunday of its week : store the day, the difference and the sunday&lt;/P&gt;&lt;P&gt;2 - extract for each week the day with the lowest difference (use firsortedvalue)&lt;/P&gt;&lt;P&gt;3 - join the data with this list of days&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 12:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55576#M9226</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2018-05-18T12:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55577#M9227</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;here is one solution to do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in this example I take the sunday of this week (actual week) as reference&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vSunday=Date(WeekEnd(Today()));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRACE $(vSunday);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;closest_to_sunday_ofactualweek:&lt;/P&gt;&lt;P&gt;LOAD Date('$(vSunday)') as weekend_date, Date#(Wait_Date,'DD/MM/YYYY') as Wait_Date, Interval(Date('$(vSunday)')-Date#(Wait_Date,'DD/MM/YYYY'),'d') as days_diff Inline [&lt;/P&gt;&lt;P&gt;Wait_Date&lt;/P&gt;&lt;P&gt;03/05/2018&lt;/P&gt;&lt;P&gt;15/05/2018&lt;/P&gt;&lt;P&gt;16/05/2018&lt;/P&gt;&lt;P&gt;17/05/2018&lt;/P&gt;&lt;P&gt;11/05/2018&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;join(closest_to_sunday_ofactualweek)&lt;/P&gt;&lt;P&gt;LOAD min(days_diff) as min Resident closest_to_sunday_ofactualweek&lt;/P&gt;&lt;P&gt;Group by weekend_date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final_table:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; * Resident closest_to_sunday_ofactualweek&lt;/P&gt;&lt;P&gt;Where days_diff=min;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table closest_to_sunday_ofactualweek;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 13:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55577#M9227</guid>
      <dc:creator>YoussefBelloum</dc:creator>
      <dc:date>2018-05-18T13:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55578#M9228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I could imagine something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;load ..., Wait_Date, week(Wait_Date) as Week, week(Wait_Date) * 10 + weekday(Wait_Date) as WeekFilter&lt;/P&gt;&lt;P&gt;from Source;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inner join(table)&lt;/P&gt;&lt;P&gt;load Week, max(WeekFilter) as MaxWeekDate resident table group by Week;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop fields Week, WeekFilter, MaxWeekDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 13:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55578#M9228</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-18T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55579#M9229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Youssef&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't use a variable for sunday as I am reading in multiple weeks worth of data so for my original example above I would need the 06/05/2018 and 11/05/2018 extracted as they are the closest date to the sunday of their current week not the current week the program is run.&amp;nbsp; For your example I would extract 03/05/2018, 11/05/2018 and 17/05/2018.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have modified the code to what I need but I am getting an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field not found - &amp;lt;min&amp;gt;&lt;/P&gt;&lt;P&gt;final_table:&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; * &lt;/P&gt;&lt;P&gt;Resident temp_table&lt;/P&gt;&lt;P&gt;Where DaysDiff = min&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;temp_table:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;CASENOTE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Interval&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;WeekEnd&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,0,0))-&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,'DD/MM/YYYY'),'d') &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;DaysDiff&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;WeekEnd&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,0,0) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;SundayDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[..\QVD\WAITING.qvd]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;);&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(temp_table)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;DaysDiff&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Group&lt;/SPAN&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;SundayDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; final_table:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;NoConcatenate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&amp;nbsp; * &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; temp_table&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Where&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;DaysDiff&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;min&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;drop&lt;/STRONG&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; temp_table; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 14:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55579#M9229</guid>
      <dc:creator>lisab80</dc:creator>
      <dc:date>2018-05-18T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55580#M9230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dates in my test example is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22/04/2018&lt;/P&gt;&lt;P&gt;29/04/2018&lt;/P&gt;&lt;P&gt;30/04/2018&lt;/P&gt;&lt;P&gt;06/05/2018&lt;/P&gt;&lt;P&gt;13/05/2018&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I tried your code I am still getting out these 5 dates whereas I should only be getting four&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22/04/2018&lt;/P&gt;&lt;P&gt;29/04/2018&lt;/P&gt;&lt;P&gt;06/05/2018&lt;/P&gt;&lt;P&gt;13/05/2018&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;temp_table:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;CASENOTE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN lang="EN" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: green; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;week&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;week&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) * 10 + &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;weekday&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN lang="EN" style="color: maroon; font-family: 'Courier New'; font-size: 9pt; mso-ansi-language: EN;"&gt;WAIT_DATE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WeekFilter&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;[..\QVD\WAITING.qvd]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;qvd&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;inner&lt;/SPAN&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(temp_table)&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;load&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;max&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WeekFilter&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;MaxWeekDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;resident&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; temp_table &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;drop&lt;/STRONG&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;fields&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WeekFilter&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;MaxWeekDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 14:46:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55580#M9230</guid>
      <dc:creator>lisab80</dc:creator>
      <dc:date>2018-05-18T14:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55581#M9231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Olivier&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can work out the first bit ok but I am struggling with points 2 and 3 would you have an example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still very new to qlikview so not very good with its syntax yet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2018 16:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55581#M9231</guid>
      <dc:creator>lisab80</dc:creator>
      <dc:date>2018-05-18T16:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55582#M9232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here with a slight adjustment by using mapping (within an additionally step) instead of joining:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table:&lt;/P&gt;&lt;P&gt;load *, week(Wait_Date) as Week, week(Wait_Date) * 10 + weekday(Wait_Date) as WeekFilter;&lt;/P&gt;&lt;P&gt;load date(date#(Wait_Date, 'DD/MM/YYYY')) as Wait_Date Inline [&lt;/P&gt;&lt;P&gt;Wait_Date&lt;/P&gt;&lt;P&gt;03/05/2018&lt;/P&gt;&lt;P&gt;15/05/2018&lt;/P&gt;&lt;P&gt;16/05/2018&lt;/P&gt;&lt;P&gt;17/05/2018&lt;/P&gt;&lt;P&gt;11/05/2018&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map:&lt;/P&gt;&lt;P&gt;mapping load Week, max(WeekFilter) as MaxWeekDate resident table group by Week;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final:&lt;/P&gt;&lt;P&gt;noconcatenate load * resident table where applymap('map', Week, 0) = WeekFilter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 May 2018 09:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55582#M9232</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-19T09:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55583#M9233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for that reply it works a treat - can I check would this be ok to run over several years - if I am using week as a filter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2018 10:51:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55583#M9233</guid>
      <dc:creator>lisab80</dc:creator>
      <dc:date>2018-05-21T10:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55584#M9234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By running over several years the logic needs to be a bit extended maybe in this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;year(Wait_Date) * 100 + week(Wait_Date) as &lt;STRONG&gt;Year&lt;/STRONG&gt;Week&lt;/P&gt;&lt;P&gt;year(Wait_Date) * 1000 + week(Wait_Date) * 10 + weekday(Wait_Date) as &lt;STRONG&gt;Year&lt;/STRONG&gt;WeekFilter&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2018 11:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55584#M9234</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-21T11:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using Row Number and Partition by to sort records</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55585#M9235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That worked perfect - thank you very much for your help - I was really stuck on that problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2018 16:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Row-Number-and-Partition-by-to-sort-records/m-p/55585#M9235</guid>
      <dc:creator>lisab80</dc:creator>
      <dc:date>2018-05-21T16:14:31Z</dc:date>
    </item>
  </channel>
</rss>

