<?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: add two total rows to summary report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663525#M198085</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is business decision to look at the summary report like that...&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;has given you the&amp;nbsp;answer.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jun 2020 15:46:47 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-06-19T15:46:47Z</dc:date>
    <item>
      <title>add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661680#M197722</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;What is the best way to add two total lines to summary report dataset (&lt;CODE class=" language-sas"&gt;summarytbl)?&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Please see the wanted data set in order to show what is the needed data set.&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data summarytbl;
input Category $ Y1 Y2 Y3;
cards;
a 10 20 30
b 20 50 40
c 15 30 80
d 50 40 20
;
run;


data wanted;
input Category $ Y1 Y2 Y3;
cards;
a 10 20 30
b 20 50 40
c 15 30 80
Total 45 100 150
d 50 40 20
Total 95 140 170
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jun 2020 11:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661680#M197722</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-06-17T11:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661683#M197724</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data summarytbl;
input Category $ Y1 Y2 Y3;
cards;
a 10 20 30
b 20 50 40
c 15 30 80
d 50 40 20
;
run;
data want;
 set summarytbl end=last;
 sum1+y1;
 sum2+y2;
 sum3+y3;
output;
if Category='c' or last then do;
  Category='Total';y1=sum1;y2=sum2;y3=sum3;output;
end;
drop sum:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jun 2020 11:27:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661683#M197724</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-06-17T11:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661686#M197727</link>
      <description>&lt;P&gt;Which information in the dataset tells you where to put the subtotal?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 11:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661686#M197727</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-17T11:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661691#M197731</link>
      <description>Hello,&lt;BR /&gt;Please see data set called  wanted that show the order of the rows:&lt;BR /&gt;a&lt;BR /&gt;b&lt;BR /&gt;c&lt;BR /&gt;Total of a b c&lt;BR /&gt;d&lt;BR /&gt;Total of a b c d&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Jun 2020 11:37:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661691#M197731</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-06-17T11:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661693#M197733</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hello,&lt;BR /&gt;Please see data set called wanted that show the order of the rows:&lt;BR /&gt;a&lt;BR /&gt;b&lt;BR /&gt;c&lt;BR /&gt;Total of a b c&lt;BR /&gt;d&lt;BR /&gt;Total of a b c d&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This does not answer my question.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 11:42:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661693#M197733</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-17T11:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661746#M197758</link>
      <description>&lt;P&gt;If your actual data involves more that those exact 4 rows of data you need to provide the rule(s) that tell us how to determine where a "summary" row goes in the data. Otherwise it is very likely you get a solution that does not extend to your actual data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a variable that identifies a group of records then tell us that changing that variable is the trigger. If you don't have such a variable then an explicit set of values for your category variable that need to be treated as a group would be another way to know when a summary should occur.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise shooting in the dark.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a set of values then a multilabel format and Proc Summary or Means could work.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 14:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661746#M197758</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-06-17T14:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661751#M197760</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hello,&lt;BR /&gt;Please see data set called wanted that show the order of the rows:&lt;BR /&gt;a&lt;BR /&gt;b&lt;BR /&gt;c&lt;BR /&gt;Total of a b c&lt;BR /&gt;d&lt;BR /&gt;Total of a b c d&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, if all you want is a program that works on this exact data set, and you never need it to work on any other data set, then &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; has given you the answer, and you should mark his reply as the correct answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, if you want it to work on a different data set, and work in general, you need to provide an explanation of the rules that have to be followed to determine where to place totals.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 14:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/661751#M197760</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-17T14:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663503#M198075</link>
      <description>&lt;P&gt;categories a b c should be order by Y value&lt;/P&gt;
&lt;P&gt;Then should have a row of total a+b+c&lt;/P&gt;
&lt;P&gt;then row of category d&lt;/P&gt;
&lt;P&gt;then row of total a+b+c+d&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 14:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663503#M198075</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-06-19T14:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663504#M198076</link>
      <description>&lt;P&gt;Is it possible to do it via proc format and then proc summary?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 14:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663504#M198076</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-06-19T14:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663510#M198079</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;categories a b c should be order by Y value&lt;/P&gt;
&lt;P&gt;Then should have a row of total a+b+c&lt;/P&gt;
&lt;P&gt;then row of category d&lt;/P&gt;
&lt;P&gt;then row of total a+b+c+d&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And what identifies the rows a,b,c as belonging to one group, and d to the rest?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 14:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663510#M198079</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-19T14:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663513#M198080</link>
      <description>It is business decision to look at the summary  report  like that...&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jun 2020 14:55:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663513#M198080</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-06-19T14:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: add two total rows to summary report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663525#M198085</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;It is business decision to look at the summary report like that...&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;has given you the&amp;nbsp;answer.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2020 15:46:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/add-two-total-rows-to-summary-report/m-p/663525#M198085</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-19T15:46:47Z</dc:date>
    </item>
  </channel>
</rss>

