<?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 Tabulate percentage column in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300846#M16995</link>
    <description>&lt;P&gt;Proc Tabulate is not designed to calculate between columns or rows other than the statistics applied to ALL groupings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since "interest" is seldom used in sums or many other statistics I suspect your data is row oriented and that Proc Report would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you insist on Tabulate then you will have to pre-calculated everything and then use tabulate just for displaying values.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Sep 2016 19:40:55 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-09-26T19:40:55Z</dc:date>
    <item>
      <title>Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300831#M16990</link>
      <description>&lt;P&gt;Hi Everyone&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two columns in my table. One is amount, the other is interest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate a third column which is interest / amount expressed as a percentage. I want to have this column for every row including the All row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how to do that using proc tabulate only?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Account Group &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Interest &amp;nbsp;Amount &amp;nbsp;Rate&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 10%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100 &amp;nbsp; &amp;nbsp; &amp;nbsp; 10000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Total &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 250 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.08%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300831#M16990</guid>
      <dc:creator>Naka</dc:creator>
      <dc:date>2016-09-26T19:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300839#M16991</link>
      <description>&lt;P&gt;You will have to use a DATA step first, to compute a single variable holding amount / interest.&amp;nbsp; PROC TABULATE permits just one analysis variable per cell.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300839#M16991</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-26T19:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300840#M16992</link>
      <description>&lt;P&gt;How do I solve the problem where when I want to create an All row, the percentages are summed up?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300840#M16992</guid>
      <dc:creator>Naka</dc:creator>
      <dc:date>2016-09-26T19:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300841#M16993</link>
      <description>&lt;P&gt;If you have just one row of data per row in the report, get the mean instead of the sum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have many rows of data per row in the report, you have to do all the calculations ahead of time.&amp;nbsp; That includes generating an extra row with the overall statistics.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300841#M16993</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-26T19:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300843#M16994</link>
      <description>&lt;P&gt;The mean of the percentages will be meaningless. I've updated my original post with an example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, there are 3 class variables with multiple values and multiple All rows. There must be a better solution out there than a datastep, which will increase the complexity of the code to an unacceptable degree.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300843#M16994</guid>
      <dc:creator>Naka</dc:creator>
      <dc:date>2016-09-26T19:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300846#M16995</link>
      <description>&lt;P&gt;Proc Tabulate is not designed to calculate between columns or rows other than the statistics applied to ALL groupings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since "interest" is seldom used in sums or many other statistics I suspect your data is row oriented and that Proc Report would work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you insist on Tabulate then you will have to pre-calculated everything and then use tabulate just for displaying values.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 19:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300846#M16995</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T19:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300866#M16996</link>
      <description>&lt;P&gt;If you would be satisfied with a plain vanilla report (no fancy colors or fonts, but complete control over the format otherwise), you could switch to the old style of customized reporting:&amp;nbsp; a DATA step with FILE and PUT statements.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300866#M16996</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-09-26T20:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300867#M16997</link>
      <description>&lt;P&gt;I don't have the flexibility and am stuck with a proc tabulate and all the design and style features that come with it... It is a massive report with very strict requirements.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300867#M16997</guid>
      <dc:creator>Naka</dc:creator>
      <dc:date>2016-09-26T20:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300880#M16999</link>
      <description>&lt;P&gt;This MAY work depending on what else you may be doing. But generally working with percents in Tabulate from two variables can be problematic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 input Account Interest Amount ;
datalines;
 1   100  1000 
 2   50  1000 
 3   100 10000 
;
run;

proc tabulate data=have;
   class account;
   var interest amount;
   table account all,
         interest*sum=''*f=best6. amount*sum=''*f=best6. interest=''*pctsum&amp;lt;amount&amp;gt;='Rate'
         ;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300880#M16999</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-26T21:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate percentage column</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300917#M17007</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This sounds like it would be a report done better with PROC REPORT than with PROC TABULATE. PROC REPORT allows you to calculate a new column on the report based on existing columns. &amp;nbsp;PROC TABULATE will not create new columns and you would have to use a DATA step program to do what you want, if the percentage can even be calculated as you envision.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; There are quite a few examples of using PROC REPORT posted already in the forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 04:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Tabulate-percentage-column/m-p/300917#M17007</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-09-27T04:36:50Z</dc:date>
    </item>
  </channel>
</rss>

