<?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 How to get top values that account for 90% of total in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213724#M52703</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the below SAS data set, I want to get the rows with top volume_ratio that account for 90% of total volumes.&amp;nbsp; Because (0.278 + 0.246 +&amp;nbsp; 0.193 + 0.190) &amp;gt; 90%, basically, I want to have a sas procedure that can get the top four rows of the below data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;product&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer_name&amp;nbsp;&amp;nbsp; volume_ratio&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.278&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.246&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.193&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.190&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.093&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is to say, the output should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;product&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer_name&amp;nbsp;&amp;nbsp; volume_ratio&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.278&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.246&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.193&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.190&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a SAS procedure that can do this work?&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2015 20:40:25 GMT</pubDate>
    <dc:creator>wutao9999</dc:creator>
    <dc:date>2015-03-31T20:40:25Z</dc:date>
    <item>
      <title>How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213724#M52703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the below SAS data set, I want to get the rows with top volume_ratio that account for 90% of total volumes.&amp;nbsp; Because (0.278 + 0.246 +&amp;nbsp; 0.193 + 0.190) &amp;gt; 90%, basically, I want to have a sas procedure that can get the top four rows of the below data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;product&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer_name&amp;nbsp;&amp;nbsp; volume_ratio&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.278&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.246&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.193&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.190&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.093&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is to say, the output should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;product&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer_name&amp;nbsp;&amp;nbsp; volume_ratio&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.278&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.246&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.193&lt;/P&gt;&lt;P&gt;apple&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; customer4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.190&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a SAS procedure that can do this work?&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 20:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213724#M52703</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2015-03-31T20:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213725#M52704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use PROC FREQ&amp;nbsp; (by product, weight volume_ratio) and then use ODS OUTPUT to write the result to a SAS dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You then use a data step with by group processing *by product" and you don't write records from the input data set to output after the first record within a by group had a cumulative frequency of &amp;gt;=90 (you can use a lag() function to retrieve the value from the previous record).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 21:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213725#M52704</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-03-31T21:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213726#M52705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The UNIVARIATE procedure will do what you want. Check out the OUTPUT statement in this procedure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 21:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213726#M52705</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-03-31T21:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213727#M52706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you give me an example?&amp;nbsp; I am a new player for SAS.&amp;nbsp; Appreciate your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 21:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213727#M52706</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2015-03-31T21:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213728#M52707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is the output you are looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards;&lt;/P&gt;&lt;P&gt;input&amp;nbsp; product $ customer_name $ volume_ratio;&lt;/P&gt;&lt;P&gt;cards;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;apple customer1 0.278&lt;/P&gt;&lt;P&gt;apple customer2 0.246&lt;/P&gt;&lt;P&gt;apple customer3 0.193&lt;/P&gt;&lt;P&gt;apple customer4 0.190&lt;/P&gt;&lt;P&gt;apple customer5 0.093&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&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;sum+volume_ratio;&lt;/P&gt;&lt;P&gt;if sum &amp;lt; round(.9) then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 21:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213728#M52707</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-03-31T21:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213729#M52708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this with the same dataset, depending your resources one could be faster than the other:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;do while(sum &amp;lt; .9);&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;sum+volume_ratio;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 21:34:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213729#M52708</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-03-31T21:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213730#M52709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this - go to the perentile example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/procstat/63963/HTML/default/viewer.htm#procstat_univariate_sect063.htm"&gt;http://support.sas.com/documentation/cdl/en/procstat/63963/HTML/default/viewer.htm#procstat_univariate_sect063.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 22:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213730#M52709</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-03-31T22:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213731#M52710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data has different products, how to handle this?&amp;nbsp; Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 23:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213731#M52710</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2015-03-31T23:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213732#M52711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general a BY statement, but it depends on your solution. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 23:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213732#M52711</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-03-31T23:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213733#M52712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have created the below codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;freq&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; = clean_model_data_temp4 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;order&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; =&amp;nbsp; data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; by product;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; weight vol_ratio;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;The code works well. How can I output all of the tables for different product into a single sas table?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 00:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213733#M52712</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2015-04-01T00:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213734#M52713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First example in the documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 id="statug.freq.freqex1" style="font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 16px; color: #000000;"&gt;Example 35.1 Output Data Set of Frequencies&lt;/H2&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_freq_sect025.htm" title="http://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_freq_sect025.htm"&gt;SAS/STAT(R) 9.22 User's Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you probably want cumulative percentages as well look at the OUTCUM option&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_freq_sect010.htm" title="http://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_freq_sect010.htm"&gt;SAS/STAT(R) 9.22 User's Guide&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 01:42:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213734#M52713</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-01T01:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213735#M52714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code like below could work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data clean_model_data_temp4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile cards;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input&amp;nbsp; product $ customer_name :$10. vol_ratio;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;apple customer1 0.278&lt;/P&gt;&lt;P&gt;apple customer2 0.246&lt;/P&gt;&lt;P&gt;apple customer3 0.193&lt;/P&gt;&lt;P&gt;apple customer4 0.190&lt;/P&gt;&lt;P&gt;apple customer5 0.093&lt;/P&gt;&lt;P&gt;orange customer1 0.278&lt;/P&gt;&lt;P&gt;orange customer2 0.246&lt;/P&gt;&lt;P&gt;orange customer3 0.193&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods _all_ close;&lt;/P&gt;&lt;P&gt;/*ods trace on;*/&lt;/P&gt;&lt;P&gt;ods output OneWayFreqs=Top90_Percent(keep=product customer_name CumPercent); &lt;/P&gt;&lt;P&gt;proc freq data = clean_model_data_temp4 order =&amp;nbsp; data;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by product;&lt;/P&gt;&lt;P&gt;&amp;nbsp; weight vol_ratio;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table customer_name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;/*ods trace off;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Top90_Percent(drop=_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set Top90_Percent;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by product;&lt;/P&gt;&lt;P&gt;&amp;nbsp; _lag_CumPercent=lag(CumPercent);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if first.product then output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if _lag_CumPercent&amp;lt;90 then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 08:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213735#M52714</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2015-04-01T08:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213736#M52715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;

data clean_model_data_temp4;
&amp;nbsp; infile cards;
&amp;nbsp; input&amp;nbsp; product $ customer_name :$10. vol_ratio;
&amp;nbsp; cards;
apple customer1 0.278
apple customer2 0.246
apple customer3 0.193
apple customer4 0.190
apple customer5 0.093
orange customer1 0.278
orange customer2 0.246
orange customer3 0.193
;
run;
data want;
 set clean_model_data_temp4;
 by product;
 retain found 0;
 if first.product then do;sum=0; found=0;end;
 sum+vol_ratio;
 if not found ;
 if sum gt 0.9 then found=1;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 13:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213736#M52715</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-04-01T13:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get top values that account for 90% of total</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213737#M52716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Appreciate all responses&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 13:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-top-values-that-account-for-90-of-total/m-p/213737#M52716</guid>
      <dc:creator>wutao9999</dc:creator>
      <dc:date>2015-04-01T13:39:54Z</dc:date>
    </item>
  </channel>
</rss>

