<?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 Report Summarize and Mean values in the same row. in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/236970#M14751</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question regarding the summarize function in proc report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 3 columns containing numbers and 2 columns containing percentages.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am wondering if there is any way to get a single row at the bottom of this table with the sum of the number columns and the combined rate of the percentage columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use BREAK AFTER / SUMMARIZE to get the sums of the number columns, but have not found a way to include the combined rate of the percentages. Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC REPORT DATA=SAMPLE_DATA ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;COLUMNS COMPANY STATE YEAR LOB NUMBER1 PERCENT1 NUMBER2 PERCENT2 NUMBER3 NUMBER4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE COMPANY / ORDER NOPRINT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE STATE / ORDER NOPRINT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE YEAR / 'Year' ORDER format=YEAR4.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER1 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER2 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER3 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER4 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE PERCENT1 / FORMAT=PERCENT10.1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE PERCENT2 / FORMAT=PERCENT10.1;&lt;BR /&gt;COMPUTE BEFORE _PAGE_ / LEFT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE COMPANY $CMPYFMT.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE STATE $STFMT.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE '&amp;nbsp; ';&lt;BR /&gt;ENDCOMP;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;BREAK AFTER STATE / PAGE SKIP;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;BREAK AFTER YEAR / SUMMARIZE style={font_weight=bold&lt;BR /&gt;&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; cellheight=.25in vjust=b};&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am looking for a summary of each year, essentially the sum of the numbers and combined rate of percents from all LOB in each year, state, company.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2015 18:22:59 GMT</pubDate>
    <dc:creator>afiehrer</dc:creator>
    <dc:date>2015-11-30T18:22:59Z</dc:date>
    <item>
      <title>Proc Report Summarize and Mean values in the same row.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/236970#M14751</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question regarding the summarize function in proc report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 3 columns containing numbers and 2 columns containing percentages.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am wondering if there is any way to get a single row at the bottom of this table with the sum of the number columns and the combined rate of the percentage columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use BREAK AFTER / SUMMARIZE to get the sums of the number columns, but have not found a way to include the combined rate of the percentages. Is this possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC REPORT DATA=SAMPLE_DATA ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;COLUMNS COMPANY STATE YEAR LOB NUMBER1 PERCENT1 NUMBER2 PERCENT2 NUMBER3 NUMBER4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE COMPANY / ORDER NOPRINT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE STATE / ORDER NOPRINT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE YEAR / 'Year' ORDER format=YEAR4.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER1 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER2 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER3 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE NUMBER4 / FORMAT=DOLLAR15.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE PERCENT1 / FORMAT=PERCENT10.1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;DEFINE PERCENT2 / FORMAT=PERCENT10.1;&lt;BR /&gt;COMPUTE BEFORE _PAGE_ / LEFT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE COMPANY $CMPYFMT.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE STATE $STFMT.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;LINE '&amp;nbsp; ';&lt;BR /&gt;ENDCOMP;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;BREAK AFTER STATE / PAGE SKIP;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;BREAK AFTER YEAR / SUMMARIZE style={font_weight=bold&lt;BR /&gt;&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; cellheight=.25in vjust=b};&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I am looking for a summary of each year, essentially the sum of the numbers and combined rate of percents from all LOB in each year, state, company.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 18:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/236970#M14751</guid>
      <dc:creator>afiehrer</dc:creator>
      <dc:date>2015-11-30T18:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize and Mean values in the same row.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/236976#M14752</link>
      <description>&lt;P&gt;Personally, I always do all my calculations in the datasteps before the report procedure. &amp;nbsp;You can use nice puctions like proc means, summary, freq etc. to do these means, and keep the report code simple. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 14:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/236976#M14752</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-11-30T14:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize and Mean values in the same row.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237005#M14755</link>
      <description>&lt;P&gt;Unless your denominators are the exact same size for all your data, the mean of a percentage (or any type of rate defined with a division) is likely to be a very misleading data element to look at.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;Salesman A contacts one customer in a month and makes one sale, so his sales rate is 100%.&lt;/P&gt;
&lt;P&gt;Salesman B contacts 2000 customers in a month and makes 1000 sales of the same amount for a sales rate of 50%.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What would an average sales rate of 75% ( 100+50)/2 actually tell you?&lt;/P&gt;
&lt;P&gt;A combine rate of (1 + 1000) / (1 +2000), which is what proc report will generally do probably tells you a lot more about what is going on with your sales staff.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 16:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237005#M14755</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-11-30T16:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize and Mean values in the same row.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237022#M14757</link>
      <description>&lt;P&gt;This is what I figured I might need to do, I just wanted to see if there was any way to get there in the report. Thanks for the response!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 17:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237022#M14757</guid>
      <dc:creator>afiehrer</dc:creator>
      <dc:date>2015-11-30T17:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize and Mean values in the same row.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237023#M14758</link>
      <description>&lt;P&gt;You are correct. I want a combined rate in the summary row of the table instead of a mean. That was my mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to get this combined rate of the percentages to appear in the same row as the sums of my number columns (ie a "total" row)?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 17:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237023#M14758</guid>
      <dc:creator>afiehrer</dc:creator>
      <dc:date>2015-11-30T17:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report Summarize and Mean values in the same row.</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237027#M14759</link>
      <description>&lt;P&gt;You should post the Proc Report code you are using. Without knowing how you are creating your current values it might be a tad difficult to guess how to calculate what you need.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 18:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-Summarize-and-Mean-values-in-the-same-row/m-p/237027#M14759</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-11-30T18:11:44Z</dc:date>
    </item>
  </channel>
</rss>

