<?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 SQL: Sum in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483158#M31324</link>
    <description>&lt;P&gt;Hello, I am looking to add a "grand totals" row at the end of my report, that provides a sum of each column in the dataset. Is there any way to do this?&lt;/P&gt;&lt;P&gt;First, I created a dataset to calculate the variables (PR) and (AB) to populate the columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table tbl_AP as&lt;BR /&gt;&amp;nbsp;select&lt;BR /&gt;&amp;nbsp;&amp;nbsp;Grlvl as GROUP,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;count(PR) as Total,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;count (AB) as Ind&lt;BR /&gt;from db.emp&lt;BR /&gt;&amp;nbsp;where GROUP= 3&lt;BR /&gt;&amp;nbsp;group by Grlvl;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;Then, I make this into a report, and add an extra column to calculate the percentage of a specific population using the two variables from tbl_AP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;Title "Distribution of People in";&lt;BR /&gt;select GROUP label="G-L",&lt;BR /&gt;&amp;nbsp;Total,&lt;BR /&gt;&amp;nbsp;Ind,&lt;BR /&gt;&amp;nbsp;Ind/Total as Ins_Percentage format=Percent8.1 label= " %"&lt;BR /&gt;from tbl_AP;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 01 Aug 2018 18:51:01 GMT</pubDate>
    <dc:creator>JibJam221</dc:creator>
    <dc:date>2018-08-01T18:51:01Z</dc:date>
    <item>
      <title>PROC SQL: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483158#M31324</link>
      <description>&lt;P&gt;Hello, I am looking to add a "grand totals" row at the end of my report, that provides a sum of each column in the dataset. Is there any way to do this?&lt;/P&gt;&lt;P&gt;First, I created a dataset to calculate the variables (PR) and (AB) to populate the columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table tbl_AP as&lt;BR /&gt;&amp;nbsp;select&lt;BR /&gt;&amp;nbsp;&amp;nbsp;Grlvl as GROUP,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;count(PR) as Total,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;count (AB) as Ind&lt;BR /&gt;from db.emp&lt;BR /&gt;&amp;nbsp;where GROUP= 3&lt;BR /&gt;&amp;nbsp;group by Grlvl;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;Then, I make this into a report, and add an extra column to calculate the percentage of a specific population using the two variables from tbl_AP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;Title "Distribution of People in";&lt;BR /&gt;select GROUP label="G-L",&lt;BR /&gt;&amp;nbsp;Total,&lt;BR /&gt;&amp;nbsp;Ind,&lt;BR /&gt;&amp;nbsp;Ind/Total as Ins_Percentage format=Percent8.1 label= " %"&lt;BR /&gt;from tbl_AP;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 18:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483158#M31324</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2018-08-01T18:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483160#M31325</link>
      <description>&lt;P&gt;It's pretty simple in PROC REPORT.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 19:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483160#M31325</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-01T19:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483164#M31327</link>
      <description>&lt;P&gt;awesome! Would I use PROC Report after putting the table together, or would this only need one PROC statement altogether?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 19:11:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483164#M31327</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2018-08-01T19:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL: Sum</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483167#M31329</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207689"&gt;@JibJam221&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;awesome! Would I use PROC Report after putting the table together, or would this only need one PROC statement altogether?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Either. It's up to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are examples in the PROC REPORT documentation of using the RBREAK command to add summary statistics at the bottom of the report.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 19:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/PROC-SQL-Sum/m-p/483167#M31329</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-01T19:18:51Z</dc:date>
    </item>
  </channel>
</rss>

