<?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 Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88927#M8331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to find the Function in SAS that will perform a sort on my Dataset of Job Roles &amp;amp; Start Dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using Enterprise Guide 4.3 &amp;amp; I want to do this sorting in an Advanced Expression, that is via The Query Builder &amp;gt;&amp;gt; 'Computed Columns' &amp;gt;&amp;gt; 'New' &amp;gt;&amp;gt; 'Advanced Expression'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Dataset has various Job Roles staff have had &amp;amp; the various Start Dates, there are multiple Job Roles &amp;amp; Start Dates for each Staff member.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the latest Start Date &amp;amp; Job Role for each Staff member.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Teradata i would use the below;&lt;/P&gt;&lt;P&gt;------------------------------------------------------&lt;/P&gt;&lt;P&gt;Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Job_Role,&lt;/P&gt;&lt;P&gt;Start_Date,&lt;/P&gt;&lt;P&gt;ROW_NUMBER OVER (PARTITION BY 'Job_Role' ORDER BY Start_Date DESC) AS Rank_No&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From Data_Table&lt;/P&gt;&lt;P&gt;------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could then filter the records for where the 'Rank_No' = 1 which would give the most current Job Role for that Staff member.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I use in SAS to do a similar task?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Jul 2013 21:38:04 GMT</pubDate>
    <dc:creator>pcfriendly</dc:creator>
    <dc:date>2013-07-24T21:38:04Z</dc:date>
    <item>
      <title>Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88927#M8331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to find the Function in SAS that will perform a sort on my Dataset of Job Roles &amp;amp; Start Dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using Enterprise Guide 4.3 &amp;amp; I want to do this sorting in an Advanced Expression, that is via The Query Builder &amp;gt;&amp;gt; 'Computed Columns' &amp;gt;&amp;gt; 'New' &amp;gt;&amp;gt; 'Advanced Expression'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Dataset has various Job Roles staff have had &amp;amp; the various Start Dates, there are multiple Job Roles &amp;amp; Start Dates for each Staff member.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to find the latest Start Date &amp;amp; Job Role for each Staff member.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Teradata i would use the below;&lt;/P&gt;&lt;P&gt;------------------------------------------------------&lt;/P&gt;&lt;P&gt;Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Job_Role,&lt;/P&gt;&lt;P&gt;Start_Date,&lt;/P&gt;&lt;P&gt;ROW_NUMBER OVER (PARTITION BY 'Job_Role' ORDER BY Start_Date DESC) AS Rank_No&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From Data_Table&lt;/P&gt;&lt;P&gt;------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could then filter the records for where the 'Rank_No' = 1 which would give the most current Job Role for that Staff member.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can I use in SAS to do a similar task?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 21:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88927#M8331</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-24T21:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88928#M8332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a datastep and first/last processing is the easiest way via program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First sort by staff member, job date descending and job role&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;by staff desc job_date job_role;&lt;/P&gt;&lt;P&gt;if first.staff then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple ways to do this though, another is a sql join with a subselect of the maximum job_date/job_role per staff member. Another is to rank the dates using SAS Rank functions and then take the top 1. Both of the above can be done using EG point and click.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 22:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88928#M8332</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-24T22:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88929#M8333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would be entering that code into a new Program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where is the reference to the source table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 22:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88929#M8333</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-24T22:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88930#M8334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually the EG solution is easy, I'm just used to thinking in Programming Steps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a Data&amp;gt;Sort Data step to sort your data first&lt;/P&gt;&lt;P&gt;By Member, Date, Job Role&lt;/P&gt;&lt;P&gt;Make sure to set date descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Sort the Output dataset again (Data&amp;gt;Sort Data) &lt;/P&gt;&lt;P&gt;But only by Member.&lt;/P&gt;&lt;P&gt;And only Options&amp;gt;Duplicate - select the option to keep only the first record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 22:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88930#M8334</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-24T22:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88931#M8335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza is correct in pointing your towards datastep, since SAS SQL does not support windowing sql functions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe there is an alternative sql formulation which will generate the same result as the partition by.&amp;nbsp; You could try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Staff&lt;/P&gt;&lt;P&gt;Job_Role,&lt;/P&gt;&lt;P&gt;max(Start_Date) as start_date&lt;/P&gt;&lt;P&gt;From Data_Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;group by staff&lt;/P&gt;&lt;P&gt;having start_date = max(start_date)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you could use select distinct and omit the having clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might be able to implement that in the query builder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 22:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88931#M8335</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-07-24T22:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88932#M8336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS Enterprise Guide also provides a task to do ranking under Tasks -&amp;gt; Data -&amp;gt; Rank&lt;/P&gt;&lt;P&gt;You will use start_date as "column to rank" and job_role as "rank by"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unter options you check "Reverse Ranking from largest to smallest" so the youngest date gets the ranking 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then use a query to select only those with ranking value 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 06:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88932#M8336</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2013-07-25T06:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88933#M8337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wasn't aware of this before, thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting some strange numbers in the Rank result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not getting a 1, 2 3 in the ranking which is what I was expecting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed I have the below options when I add the Rank node to the graph as below;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sort By Variables under the Data area&lt;/LI&gt;&lt;LI&gt;Ranking Method under the Options area&lt;/LI&gt;&lt;LI&gt;If values tie, use;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What shoud I choose for these to get a 1,2,3 Ranking?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 09:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88933#M8337</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-25T09:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88934#M8338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pcfriendly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the defaults for the data and assign the roles as stated earlier&lt;/P&gt;&lt;P&gt;the Ranking method should be "smallest to largest"&lt;/P&gt;&lt;P&gt;check the box "Reverse Ranking from smallest to largest"&lt;/P&gt;&lt;P&gt;leave the default for "if values tie"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 11:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88934#M8338</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2013-07-25T11:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88935#M8339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using EG 4.3 version, it doesn't have the option of 'Options&amp;gt;Duplicate' - select the option to keep only the first record.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 21:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88935#M8339</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-25T21:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88936#M8340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using 4.2 and it does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tasks&amp;gt;Data&amp;gt;Sort Data&lt;/P&gt;&lt;P&gt;Left hand side &amp;gt; Options&lt;/P&gt;&lt;P&gt;Duplicate is in the second set of options. It could have been removed in 4.3 I suppose...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="SAS EG Options.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/3940_SAS EG Options.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 21:56:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88936#M8340</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-25T21:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88937#M8341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bruno,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My options to choose under the Data area in the Rank icon are as follows;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Job_Role sort order - which I've set to Descending&lt;/LI&gt;&lt;LI&gt;Columns to Rank - Start_Date&lt;/LI&gt;&lt;LI&gt;Rank By - Job_Role&lt;/LI&gt;&lt;LI&gt;Sort by Variables checkbox - not sure if I should leave it checked?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;My options to choose under the Options area in the Rank icon are as follows;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ranking method - Smallest to Largest Radio Button&lt;/LI&gt;&lt;LI&gt;If values tie, use; - Default is Median, other options are 'High Rank', 'Low Rank'&lt;/LI&gt;&lt;LI&gt;There's also a checkbox for 'Reverse Ranking from largest to smallest' doesn't this negate the Ranking Method already set to 'Smallest to Largest?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The date field I'm using is a Date Time value &amp;amp; I'm getting results like 403.5 in my ranking results?? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 21:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88937#M8341</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-25T21:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88938#M8342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see the same window as REEza in EG 4.3.0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 22:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88938#M8342</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2013-07-25T22:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88939#M8343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Reeza, you're right, I was in a 'Rank' Icon instead of a Sort Icon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My screen looks exactly like yours &amp;amp; does have the Duplicates option area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under 'Data', I've added the Start_Date filed in the 'Sort By' area descending &amp;amp; under 'Options' I have selected the 'Keep only the first record for each 'Sort By' group' option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My results are showing more than one date for the Job_Role though?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it correct to just add one field in the Task Roles - Sort By area?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, what is 'Columns to be dropped for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 22:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88939#M8343</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-25T22:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88940#M8344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right Larry, I was in the wrong task icon, Rank instead of Sort... DUH !!:smileysilly:&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 22:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88940#M8344</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-25T22:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88941#M8345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't quite understand your specific requirements so my suggestion would be to try a bunch of different things until you get what you want....scientific, I know. But you probably have a better idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logis is to sort first on your key fields and then to sort only on what you want to be the UNIQUE key and everything else that is duplicate will be winnowed out.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Columns to be dropped probably allows you to not include all variables in your final dataset, for example if you only wanted unique members.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 22:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88941#M8345</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-07-25T22:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88942#M8346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, thanks Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing that now to see how I can just get the row that has the latest Start_Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jul 2013 22:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88942#M8346</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-25T22:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88943#M8347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all, especially, Reeza &amp;amp; Bruno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I eventually figured out to do the Rank using only the 2 Fields &amp;amp; got the Rank Number &amp;amp; then ran a query builder to select where the Rank Number = 1 as you said Bruno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will come in very handy, Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 00:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/88943#M8347</guid>
      <dc:creator>pcfriendly</dc:creator>
      <dc:date>2013-07-26T00:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/298608#M20362</link>
      <description>&lt;P&gt;you can use proc rank to rank your data first, then using the rank to find first, second, .... or last one.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2016 11:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/298608#M20362</guid>
      <dc:creator>HRI</dc:creator>
      <dc:date>2016-09-15T11:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/345945#M22896</link>
      <description>&lt;P&gt;It's all well and good that you can rank using the menu system, however how would this translate to code?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 19:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/345945#M22896</guid>
      <dc:creator>Eurisko</dc:creator>
      <dc:date>2017-03-30T19:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Find Latest value using ROW_NUMBER OVER (PARTITION BY 'X' ORDER BY DATE) AS Rank in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/379270#M24678</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i hav a challenge working out the code i use the GUI and then click on the code tab once executed to see what SAS EG does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ranking code would look like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SORT
	DATA=inputdata  
	OUT=sorted_data_set
	;
	BY {customer number};
RUN;
PROC RANK DATA = sorted_data_set
	DESCENDING /* use decending if using dates so the most current record is a 1 */
	TIES=LOW
	OUT=WORK.RankedData;
	BY {customer number};
	VAR {date};
RANKS ranking_number;
RUN;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may need to do query after this to filter the output so you are selecting records that have a rank of 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 05:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Find-Latest-value-using-ROW-NUMBER-OVER-PARTITION-BY-X-ORDER-BY/m-p/379270#M24678</guid>
      <dc:creator>SamuelD</dc:creator>
      <dc:date>2017-07-26T05:07:24Z</dc:date>
    </item>
  </channel>
</rss>

