<?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 Need to get Top 5% of customers data ! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-get-Top-5-of-customers-data/m-p/151165#M262482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I need a output dataset with top 5% of transactions from total transaction amount to give promotional offers to the top 5% customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Nov 2013 09:34:12 GMT</pubDate>
    <dc:creator>SOORISAS</dc:creator>
    <dc:date>2013-11-21T09:34:12Z</dc:date>
    <item>
      <title>Need to get Top 5% of customers data !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-get-Top-5-of-customers-data/m-p/151165#M262482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I need a output dataset with top 5% of transactions from total transaction amount to give promotional offers to the top 5% customers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 09:34:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-get-Top-5-of-customers-data/m-p/151165#M262482</guid>
      <dc:creator>SOORISAS</dc:creator>
      <dc:date>2013-11-21T09:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get Top 5% of customers data !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-get-Top-5-of-customers-data/m-p/151166#M262483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure its clear what you are asking about. Are you wanting the top 5% of customers from the top 5% of transactions? Or do you want the top 5% of customers based on all transactions. And you didnt not mention how to define the "top". Is it total Money, number of items ordered, number of orders, etc... .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What ever the definition is there are many ways to get at what you want. Something like this should help you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table test as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select make, sum(msrp) as amt format=dollar10.&lt;/P&gt;&lt;P&gt;&amp;nbsp; from sashelp.cars&lt;/P&gt;&lt;P&gt;&amp;nbsp; group by make&lt;/P&gt;&lt;P&gt;&amp;nbsp; order by calculated amt desc&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; sum(amt) , round(sum(amt)*.05,1)&amp;nbsp; into :tamt, :tpct&lt;/P&gt;&lt;P&gt;&amp;nbsp; from test&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Create table out as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select make, amt &lt;/P&gt;&lt;P&gt;&amp;nbsp; from test&lt;/P&gt;&lt;P&gt;&amp;nbsp; where amt &amp;gt; &amp;amp;tpct&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;tamt &amp;amp;tpct;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 13:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-get-Top-5-of-customers-data/m-p/151166#M262483</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-11-21T13:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need to get Top 5% of customers data !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-get-Top-5-of-customers-data/m-p/151167#M262484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select int(count(*) * .05) as recs&lt;/P&gt;&lt;P&gt;into :Recs&lt;/P&gt;&lt;P&gt;from have;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql outobs=&amp;amp;recs;&lt;/P&gt;&lt;P&gt;create table offers as&lt;/P&gt;&lt;P&gt;select * from have&lt;/P&gt;&lt;P&gt;order by total_trans_amt desc;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Nov 2013 13:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-get-Top-5-of-customers-data/m-p/151167#M262484</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-11-21T13:24:06Z</dc:date>
    </item>
  </channel>
</rss>

