<?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 Selecting Largest Value By Multiple Groups in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-Largest-Value-By-Multiple-Groups/m-p/456882#M29434</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table containing various Entities, each entity can have up to 5 reference numbers and each reference number can have an unlimited number of amounts associated with it.&amp;nbsp; So 3 columns, Entity, Reference, Amount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to extract a table that contains one result for each Entity and Reference combination and the largest Amount.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done this before using the Sort task, but I can't get it to work where I'm grouping by more than one column in the Sort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any top tips?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 24 Apr 2018 14:25:11 GMT</pubDate>
    <dc:creator>paulrockliffe</dc:creator>
    <dc:date>2018-04-24T14:25:11Z</dc:date>
    <item>
      <title>Selecting Largest Value By Multiple Groups</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-Largest-Value-By-Multiple-Groups/m-p/456882#M29434</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table containing various Entities, each entity can have up to 5 reference numbers and each reference number can have an unlimited number of amounts associated with it.&amp;nbsp; So 3 columns, Entity, Reference, Amount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to extract a table that contains one result for each Entity and Reference combination and the largest Amount.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done this before using the Sort task, but I can't get it to work where I'm grouping by more than one column in the Sort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any top tips?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 14:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-Largest-Value-By-Multiple-Groups/m-p/456882#M29434</guid>
      <dc:creator>paulrockliffe</dc:creator>
      <dc:date>2018-04-24T14:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Largest Value By Multiple Groups</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-Largest-Value-By-Multiple-Groups/m-p/456885#M29435</link>
      <description>&lt;P&gt;Post example test data in the form of a datastep, and what the output from that should be.&amp;nbsp; I cant guess from that why:&lt;/P&gt;
&lt;PRE&gt;proc sort data=have out=want nodupkey;
  by entity reference descending amount;
run;&lt;/PRE&gt;
&lt;P&gt;Would not work.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 14:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-Largest-Value-By-Multiple-Groups/m-p/456885#M29435</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-24T14:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Largest Value By Multiple Groups</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-Largest-Value-By-Multiple-Groups/m-p/456898#M29436</link>
      <description>&lt;P&gt;Here's a way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have nway;&lt;/P&gt;
&lt;P&gt;class entity refno;&lt;/P&gt;
&lt;P&gt;var amount;&lt;/P&gt;
&lt;P&gt;output out=want (keep=entity refno amount) max=;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are ways to do this where you run PROC SORT first, but you then need a DATA step to select the desired observations.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 17:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Selecting-Largest-Value-By-Multiple-Groups/m-p/456898#M29436</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-24T17:07:16Z</dc:date>
    </item>
  </channel>
</rss>

