<?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 &amp;quot;Total&amp;quot; to the table in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518782#M3620</link>
    <description>&lt;P&gt;That is just perfect.&lt;/P&gt;&lt;P&gt;It works very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Nazanin&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 13:52:59 GMT</pubDate>
    <dc:creator>NazaninSAS</dc:creator>
    <dc:date>2018-12-05T13:52:59Z</dc:date>
    <item>
      <title>How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518436#M3542</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to generate this table:&lt;/P&gt;&lt;TABLE border="1" cellspacing="1" cellpadding="2"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;FONT face="Arial" size="3"&gt;&lt;STRONG&gt;REGION&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;FONT face="Arial" size="3"&gt;&lt;STRONG&gt;SI_PRI&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;FONT face="Arial" size="3"&gt;&lt;STRONG&gt;PRI&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;FONT face="Arial" size="3"&gt;&lt;STRONG&gt;Return rate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="left"&gt;&lt;FONT face="Arial" size="3"&gt;ATLANTIC&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;3570&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;3954&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;90.3%&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="left"&gt;&lt;FONT face="Arial" size="3"&gt;HQ&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;10991&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;12165&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;90.3%&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="left"&gt;&lt;FONT face="Arial" size="3"&gt;ONTARIO&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;10301&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;11830&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;87.1%&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="left"&gt;&lt;FONT face="Arial" size="3"&gt;PACIFIC&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;4232&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;4768&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;88.8%&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="left"&gt;&lt;FONT face="Arial" size="3"&gt;PRAIRIES&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;5279&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;6297&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;83.8%&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="left"&gt;&lt;FONT face="Arial" size="3"&gt;QUEBEC&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;4399&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;4950&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;88.9%&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="left"&gt;&lt;FONT face="Arial" size="3"&gt;&lt;STRONG&gt;Total&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Calibri" size="3"&gt;&lt;STRONG&gt;38772&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Calibri" size="3"&gt;&lt;STRONG&gt;43964&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="right"&gt;&lt;FONT face="Arial" size="3"&gt;&lt;STRONG&gt;88.9%&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the code I wrote:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; REGION, count(SI_PRI) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SI_PRI, count (PRI)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; PRI, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;calculated SI_PRI/calculated PRI &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"Return rate"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; format=&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;percent8.1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.Final2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;group&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; REGION;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;this is the output I receive.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;STRONG&gt;REGION&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;STRONG&gt;SI_PRI&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt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t;6297&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;83.8%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;QUEBEC&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4399&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4950&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;88.9%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I change my code to get the first table as an output?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nazanin&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:03:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518436#M3542</guid>
      <dc:creator>NazaninSAS</dc:creator>
      <dc:date>2018-12-04T15:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518439#M3544</link>
      <description>&lt;P&gt;Usually you don't use SQL to create end user reports.&lt;/P&gt;
&lt;P&gt;take a look at PROC TABULATE and PROC REPORT.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518439#M3544</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-12-04T15:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518440#M3545</link>
      <description>&lt;P&gt;PROC SQL is probably not the right tool here. I take it that you want a report and not a data set, correct? See &lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n1dz7jdasx5t56n1rmlx346dyk6n.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;PROC REPORT Documentation&lt;/A&gt; for examples of this kind of issue.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518440#M3545</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-04T15:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518444#M3547</link>
      <description>&lt;P&gt;This comes up one every 20 posts or so.&amp;nbsp; Please use the search functionality to look before posting.&amp;nbsp; Here is one from yesterday:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/insert-a-row-at-the-end-of-specific-rows-with-Totals/m-p/518000#M140142" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/insert-a-row-at-the-end-of-specific-rows-with-Totals/m-p/518000#M140142&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518444#M3547</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-04T15:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518446#M3548</link>
      <description>&lt;P&gt;for creating the dataset in proc sql try the below code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input REGION $	SI_PRI	PRI	Return_rate;
cards;
ATLANTIC 3570 3954 0.903
HQ 10991 12165 0.903
ONTARIO 10301 11830 0.871
PACIFIC 4232 4768 0.888
PRAIRIES 5279 6297 0.838
QUEBEC 4399 4950 0.889
;

proc sql;
create table want as 
 select 'Total' as region , sum(SI_PRI) as SI_PRI, sum(PRI) as PRI, sum(Return_rate) from have 
 union 
 select * from have;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518446#M3548</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-12-04T15:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518780#M3619</link>
      <description>&lt;P&gt;Code not tested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;REGION, count(SI_PRI)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SI_PRI, count (PRI)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;PRI,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;calculated SI_PRI/calculated PRI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"Return rate"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;format=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;percent8.1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;work.Final2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;group&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;REGION&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;union all&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;'TOTAL'&lt;/SPAN&gt;, count(SI_PRI)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SI_PRI, count (PRI)&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;PRI,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;calculated SI_PRI/calculated PRI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"Return rate"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;format=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;percent8.1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;work.Final2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 13:43:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518780#M3619</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-12-05T13:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518782#M3620</link>
      <description>&lt;P&gt;That is just perfect.&lt;/P&gt;&lt;P&gt;It works very well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Nazanin&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 13:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518782#M3620</guid>
      <dc:creator>NazaninSAS</dc:creator>
      <dc:date>2018-12-05T13:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518786#M3622</link>
      <description>&lt;P&gt;I don't think the code from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;gives correct answers in the presence of missing values for PRI or SI_PRI.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518786#M3622</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-05T14:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518790#M3624</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I have missing values in SI-PRI.&lt;/P&gt;&lt;P&gt;why do you think it will not give a correct answer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nazanin&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518790#M3624</guid>
      <dc:creator>NazaninSAS</dc:creator>
      <dc:date>2018-12-05T14:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518792#M3625</link>
      <description>&lt;P&gt;Because the count function treats them the same as if the values were not missing.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518792#M3625</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-05T14:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518796#M3626</link>
      <description>&lt;P&gt;Ou. I know what Paige means.&lt;/P&gt;
&lt;P&gt;If you want include missing value into TOTAL row.&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;union all&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;'TOTAL'&lt;/SPAN&gt;, &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;count(*)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SI_PRI, &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;count (*)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;PRI,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;calculated SI_PRI/calculated PRI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"Return rate"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;format=&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;percent8.1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;work.Final2&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518796#M3626</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-12-05T14:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518797#M3627</link>
      <description>&lt;P&gt;the first one was correct.&lt;/P&gt;&lt;P&gt;I want the sum of the above rows!&lt;/P&gt;&lt;P&gt;the second one gives me the total of all rows!&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nazanin&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518797#M3627</guid>
      <dc:creator>NazaninSAS</dc:creator>
      <dc:date>2018-12-05T14:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518798#M3628</link>
      <description>&lt;P&gt;Well, not so fast.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem you will have is if either PRI or SI_PRI is missing &lt;STRONG&gt;and the other one is not missing&lt;/STRONG&gt;. The end result, the ratio, still will not be correct if this happens.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518798#M3628</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-05T14:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518801#M3629</link>
      <description>&lt;P&gt;this is what I get:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;STRONG&gt;REGION&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;STRONG&gt;SI_PRI&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;STRONG&gt;PRI&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P align="center"&gt;&lt;STRONG&gt;Return rate&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;ATLANTIC&lt;/P&gt;&lt;/TD&gt;&lt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t;P&gt;4950&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;88.9%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;TOTAL&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;38772&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;43964&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;88.2%&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems correct &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I always have missing in SI_PRI because of that I calculate the return rate to see how many responded.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518801#M3629</guid>
      <dc:creator>NazaninSAS</dc:creator>
      <dc:date>2018-12-05T14:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518803#M3630</link>
      <description>&lt;P&gt;Ok, that's great it works for your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for any other data sets and for anyone else reading along, in general, this process of performing statistics in PROC SQL on two different variables and then taking the ratio is not going to work if one variable is missing and the other variable is present. I see this done often to compute weighted averages in SQL, and as stated, missing values are not handled properly and the wrong value results. This is why I always recommend PROC SUMMARY to do weighted averages and the like, because the missings are handled properly. PROC SUMMARY also has the benefit of automatically computing totals for you, and you don't have to write and debug extra SQL code just to get the totals.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518803#M3630</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-05T14:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518804#M3631</link>
      <description>&lt;P&gt;I'm also going to try ProcSummary.&lt;/P&gt;&lt;P&gt;would you please guide me to a good source for PROCSummary?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nazanin&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518804#M3631</guid>
      <dc:creator>NazaninSAS</dc:creator>
      <dc:date>2018-12-05T14:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "Total" to the table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518810#M3633</link>
      <description>&lt;P&gt;The only source I know of is the SAS documentation at:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0aq3hsvflztfzn1xa2wt6s35oy6.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0aq3hsvflztfzn1xa2wt6s35oy6.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are examples in the PROC MEANS documentation which should work identically in PROC SUMMARY (but I haven't tested them in PROC SUMMARY)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0f0fjpjeuco4gn1ri963f683mi4.htm&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0f0fjpjeuco4gn1ri963f683mi4.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only quirk you might want to know is that PROC SUMMARY puts the totals at the top of the output data set, whereas you want them at the bottom, but you can do a sort BY DESCENDING _TYPE_; and then the totals are at the bottom.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 14:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-quot-Total-quot-to-the-table/m-p/518810#M3633</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-05T14:44:24Z</dc:date>
    </item>
  </channel>
</rss>

