<?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 Re: Proc Rank - excluding zeros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146585#M297362</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using a view:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data v / view=v;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set &amp;amp;reportname;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if txns &amp;gt; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then r_txns = txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if ol_txns &amp;gt; 0 then r_ol_txns = ol_txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if st_txns &amp;gt; 0 then r_st_txns = st_txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc rank data=v out=&amp;amp;reportname&amp;nbsp; groups=10 ties=high;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var r_txns r_ol_txns r_st_txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;by segment;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Oct 2014 00:28:31 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2014-10-29T00:28:31Z</dc:date>
    <item>
      <title>Proc Rank - excluding zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146583#M297360</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 am trying to create deciles for sales data - by channel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have a list of customers with their total sales, online sales, and store sales.&amp;nbsp; I want to create ranked deciles for each one of these.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;seems easy, but here's the catch.&amp;nbsp; I want to ignore zeros.&amp;nbsp; In many cases their sales will be in stores onlty so there will be a zero for online sales.&amp;nbsp; I don't want to include that record in the ranking of online.&lt;/P&gt;&lt;P&gt;Will i need to split them up into separate tables to do this and then put them back together?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here;s the current code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; proc &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;rank&lt;/SPAN&gt;&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;=&amp;amp;reportname &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=&amp;amp;reportname&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;groups&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;10&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;ties&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=high;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt; ranks&lt;/STRONG&gt; r_txns r_ol_txns r_st_txns;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt; var&lt;/STRONG&gt; txns ol_txns st_txns;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt; by&lt;/STRONG&gt; segment;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&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;any guidance would be much appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 22:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146583#M297360</guid>
      <dc:creator>hamhocks</dc:creator>
      <dc:date>2014-10-28T22:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank - excluding zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146584#M297361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably need a variable with missing instead of 0 for the online. If you might need the original value then take a pass through a data step to add a new variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 23:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146584#M297361</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-28T23:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank - excluding zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146585#M297362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using a view:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data v / view=v;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set &amp;amp;reportname;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if txns &amp;gt; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then r_txns = txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if ol_txns &amp;gt; 0 then r_ol_txns = ol_txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if st_txns &amp;gt; 0 then r_st_txns = st_txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc rank data=v out=&amp;amp;reportname&amp;nbsp; groups=10 ties=high;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;var r_txns r_ol_txns r_st_txns;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;by segment;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(untested)&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 00:28:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146585#M297362</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-10-29T00:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Rank - excluding zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146586#M297363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks! this worked perfectly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2014 06:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Rank-excluding-zeros/m-p/146586#M297363</guid>
      <dc:creator>hamhocks</dc:creator>
      <dc:date>2014-11-12T06:01:37Z</dc:date>
    </item>
  </channel>
</rss>

