<?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: How to add a summary to Proc Reports in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/777878#M25444</link>
    <description>&lt;P&gt;What does your data look like? And what is your desired result?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Nov 2021 11:02:11 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2021-11-02T11:02:11Z</dc:date>
    <item>
      <title>How to add a summary to Proc Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/777876#M25443</link>
      <description>&lt;P&gt;This is my first time here, I hope that you will help me. I would like to add SUM / MEANS as a summary using Proc Reports. ?The following code does not help me if there is any possibility&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="sas"&gt;proc report data=customer;
column date customer ,number_sold
define date / group;
define customer / across;
define number_sold/ mean;
define number_sold/ sum;
run;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DATE&lt;/TD&gt;&lt;TD&gt;Customer 1&lt;/TD&gt;&lt;TD&gt;Customer 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-08&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;95&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2021-08&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;77&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SUM&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;172&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Mean&lt;/TD&gt;&lt;TD&gt;1,5&lt;/TD&gt;&lt;TD&gt;86&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 02 Nov 2021 10:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/777876#M25443</guid>
      <dc:creator>Palucci</dc:creator>
      <dc:date>2021-11-02T10:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a summary to Proc Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/777878#M25444</link>
      <description>&lt;P&gt;What does your data look like? And what is your desired result?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 11:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/777878#M25444</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-11-02T11:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a summary to Proc Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/777881#M25445</link>
      <description>At the top, this table is my result that I want to achieve. and the data look the same but without Sum / Median</description>
      <pubDate>Tue, 02 Nov 2021 11:10:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/777881#M25445</guid>
      <dc:creator>Palucci</dc:creator>
      <dc:date>2021-11-02T11:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a summary to Proc Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/778156#M25446</link>
      <description>&lt;P&gt;You can't do it in proc report.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pre-process data before proc report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table report as
select 1 as id, put(date,yymmd7.) as date length=20, stock as customer, sum(close) as numer_sold
 from sashelp.stocks
  where date&amp;lt;'01jan1987'd
   group by  calculated date ,stock
union all
select 2,'sum', stock as customer,sum(close) as numer_sold
  from sashelp.stocks
   where date&amp;lt;'01jan1987'd
    group by  stock
union all
select 3,'mean', stock as customer,mean(close) as numer_sold
  from sashelp.stocks
   where date&amp;lt;'01jan1987'd
    group by  stock
  ;
  quit;

proc report data=report nowd;
column id date numer_sold,customer;
define id/group noprint;
define date/group;
define customer/across ' ';
define numer_sold/analysis sum ' ';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Nov 2021 12:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/778156#M25446</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-11-03T12:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a summary to Proc Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/778164#M25447</link>
      <description>&lt;P&gt;I moved this to the "Base Reporting" community. Maybe&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;can chime in with a clever trick.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 12:33:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/778164#M25447</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-03T12:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a summary to Proc Reports</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/778261#M25448</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;You can do what you want to do with PROC REPORT, but it will take some different coding. You are showing your desired results. For CUSTOMER to be used as an across variable, the data has to look different than what you show in your first post. Consider this code and the report it produces. The 19 rows in SASHELP.CLASS are shown with AGE as the GROUP item and with height nested within each value of SEX, which is the ACROSS variable.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1635958643451.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65360iDE6DDB079C9DF005/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1635958643451.png" alt="Cynthia_sas_0-1635958643451.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to add an extra summary line at the bottom, then you have to do data manipulation like I show in this paper &lt;A href="https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/resources/papers/proceedings17/SAS0431-2017.pdf&lt;/A&gt; in Example 2, 3, 4 or 5. Probably #5, but without really seeing your actual data, it's hard to guess.&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 16:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-add-a-summary-to-Proc-Reports/m-p/778261#M25448</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-11-03T16:58:03Z</dc:date>
    </item>
  </channel>
</rss>

