<?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 Ranking Output and then grouping the remaining in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Ranking-Output-and-then-grouping-the-remaining/m-p/515626#M2950</link>
    <description>&lt;P&gt;I used order by to order my randomly arranged data so now I have the following data :&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input name $4. count ;&lt;BR /&gt;datalines;&lt;BR /&gt;john 100&lt;BR /&gt;Harr 90&lt;BR /&gt;Rick 80&lt;BR /&gt;Gini 70&lt;BR /&gt;kell 70&lt;BR /&gt;Rini 67&lt;BR /&gt;Holl 65&lt;BR /&gt;Radd 65&lt;BR /&gt;lola 60&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want as the output is the top 5 names with the corresponding counts and then for the 6th row I want&amp;nbsp;everything left to be grouped together labelled as 'Othr' and their counts summed.&lt;/P&gt;&lt;P&gt;john 100&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Harr 90&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rick 80&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gini 70&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;kell 70&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Othr 257&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Nov 2018 18:21:18 GMT</pubDate>
    <dc:creator>new_sas_user_4</dc:creator>
    <dc:date>2018-11-23T18:21:18Z</dc:date>
    <item>
      <title>Ranking Output and then grouping the remaining</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Ranking-Output-and-then-grouping-the-remaining/m-p/515626#M2950</link>
      <description>&lt;P&gt;I used order by to order my randomly arranged data so now I have the following data :&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input name $4. count ;&lt;BR /&gt;datalines;&lt;BR /&gt;john 100&lt;BR /&gt;Harr 90&lt;BR /&gt;Rick 80&lt;BR /&gt;Gini 70&lt;BR /&gt;kell 70&lt;BR /&gt;Rini 67&lt;BR /&gt;Holl 65&lt;BR /&gt;Radd 65&lt;BR /&gt;lola 60&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want as the output is the top 5 names with the corresponding counts and then for the 6th row I want&amp;nbsp;everything left to be grouped together labelled as 'Othr' and their counts summed.&lt;/P&gt;&lt;P&gt;john 100&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Harr 90&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rick 80&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gini 70&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;kell 70&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Othr 257&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How can I achieve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 18:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Ranking-Output-and-then-grouping-the-remaining/m-p/515626#M2950</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2018-11-23T18:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking Output and then grouping the remaining</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Ranking-Output-and-then-grouping-the-remaining/m-p/515630#M2952</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name $4. count ;
datalines;
john 100
Harr 90
Rick 80
Gini 70
kell 70
Rini 67
Holl 65
Radd 65
lola 60
;
data want;
set have end=lr;
if _n_&amp;gt;5 then s+count;
if lr then do;
count=s;
name='other';
end;
if lr or _n_&amp;lt;=5 then output;
drop s;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Nov 2018 18:36:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Ranking-Output-and-then-grouping-the-remaining/m-p/515630#M2952</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-23T18:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Ranking Output and then grouping the remaining</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Ranking-Output-and-then-grouping-the-remaining/m-p/515651#M2962</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;!!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 20:16:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Ranking-Output-and-then-grouping-the-remaining/m-p/515651#M2962</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2018-11-23T20:16:48Z</dc:date>
    </item>
  </channel>
</rss>

