<?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 Proc tabulate and pctsum in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-and-pctsum/m-p/121191#M33407</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following table statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table month * (GQBProduct all) , (sale_wt dispwt) * (sum pctsum &amp;lt;sale_wt&amp;gt;) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works as it should but it's not quite what I want.&amp;nbsp; How do I rewrite the statement such that it displays sale_wt, dispwt and the pctsum for dispwt/sale_wt but not the pctsum of the sale_wt/sale_wt (which is always 100%)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Feb 2013 21:38:15 GMT</pubDate>
    <dc:creator>Bill</dc:creator>
    <dc:date>2013-02-25T21:38:15Z</dc:date>
    <item>
      <title>Proc tabulate and pctsum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-and-pctsum/m-p/121191#M33407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the following table statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table month * (GQBProduct all) , (sale_wt dispwt) * (sum pctsum &amp;lt;sale_wt&amp;gt;) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works as it should but it's not quite what I want.&amp;nbsp; How do I rewrite the statement such that it displays sale_wt, dispwt and the pctsum for dispwt/sale_wt but not the pctsum of the sale_wt/sale_wt (which is always 100%)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 21:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-and-pctsum/m-p/121191#M33407</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2013-02-25T21:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate and pctsum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-and-pctsum/m-p/121192#M33408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The easiest thing to do is change your parentheses so that you get a different keyword statistic (SUM?) used for sale_wt and disp_wt and then just use your PCTSUM&amp;lt;SALE_WT&amp;gt; with DISPWT, as shown in #2 below. I had to make some fake data, so the numbers are probably a bit wonky because of the variables I used as "stand-ins" for SALE_WT and DISPWT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** make some fake data;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data testit;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; set sashelp.prdsale;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; ** only get 3 months;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; where quarter = 1;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; gqbproduct = prodtype;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; sale_wt = actual/100;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; dispwt = predict/100;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\tab_examp.html' style=sasweb;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc tabulate data=testit;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; class gqbproduct month;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var sale_wt dispwt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; table month * (GQBProduct all) ,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (sale_wt dispwt) * (sum pctsum &amp;lt;sale_wt&amp;gt;) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /box='1) Original code';&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; table month * (GQBProduct all) ,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (sale_wt dispwt)*sum dispwt*(pctsum &amp;lt;sale_wt&amp;gt;) &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /box='2) Changed Code';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Feb 2013 22:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-and-pctsum/m-p/121192#M33408</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-02-25T22:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate and pctsum</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-and-pctsum/m-p/121193#M33409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Cynthia!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 15:09:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-tabulate-and-pctsum/m-p/121193#M33409</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2013-02-26T15:09:21Z</dc:date>
    </item>
  </channel>
</rss>

