<?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 add totals rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623768#M183681</link>
    <description>Have a look at the docs, you have to place the keyword ALL in the row-part of the tables-statement.</description>
    <pubDate>Tue, 11 Feb 2020 06:36:24 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-02-11T06:36:24Z</dc:date>
    <item>
      <title>proc tabulate add totals rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623765#M183679</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I wan to add Total row under each score and also grand total row.&lt;/P&gt;
&lt;P&gt;So there will be extra 3 total rows (one for score 'a' , second for score 'b'&amp;nbsp; and 3rd for grand total&lt;/P&gt;
&lt;P&gt;What is the way to do it please using proc tabulate?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data rawtbl;
informat ddate date9.;
format ddate date9.;
input ID ddate score $ Y;
cards;
1 '10NOV2019'd a 100
2 '10NOV2019'd a 200
3 '10NOV2019'd a 250
4 '10NOV2019'd b 300
5 '10NOV2019'd b 50
6 '11NOV2019'd b 150
7 '11NOV2019'd b 100
8 '11NOV2019'd a 200
9 '11NOV2019'd a 250
10 '12NOV2019'd a 300
11 '12NOV2019'd a 50
12 '12NOV2019'd b 150 
;
run;

title;
proc tabulate data=rawtbl f=6. out=want;
class score  ddate;
var Y;
tables score*ddate, Y*(sum PCTN);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Feb 2020 06:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623765#M183679</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-11T06:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate add totals rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623768#M183681</link>
      <description>Have a look at the docs, you have to place the keyword ALL in the row-part of the tables-statement.</description>
      <pubDate>Tue, 11 Feb 2020 06:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623768#M183681</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-02-11T06:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate add totals rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623773#M183683</link>
      <description>&lt;P&gt;When I add ALL&amp;nbsp; then I get global total.&lt;/P&gt;
&lt;P&gt;It is good but I need also to get total after each score...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title;
proc tabulate data=rawtbl f=6. out=want;
class score  ddate;
var Y;
tables score *ddate ALL, Y*(sum PCTN);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Feb 2020 06:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623773#M183683</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-11T06:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate add totals rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623775#M183684</link>
      <description>&lt;P&gt;Great!! I got solution&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title;
proc tabulate data=rawtbl f=6. out=want;
class score  ddate;
var Y;
tables score *(ddate All='total') ALL, Y*(sum PCTN);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Feb 2020 07:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623775#M183684</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-11T07:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate add totals rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623776#M183685</link>
      <description>&lt;P&gt;It is a bit confusing because I add total for each score and not for each date......but in the code I need to add ALL keyword near date and not not near score&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 07:10:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623776#M183685</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-11T07:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate add totals rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623778#M183687</link>
      <description>&lt;P&gt;Sorry, i don't get it. Can you show want you want?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 07:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-tabulate-add-totals-rows/m-p/623778#M183687</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-02-11T07:23:04Z</dc:date>
    </item>
  </channel>
</rss>

