<?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 report add total of amount in the header in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411966#M67380</link>
    <description>&lt;P&gt;I don't know what you mean by "in the header"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To me, that's just the first row of the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you did PROC SUMMARY properly, it does the calculations, including the "header" sum, and then PROC REPORT just takes the output from PROC SUMMARY and formats into a nice readable table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a simple example using SASHELP.CLASS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc summary data=sashelp.class;
    class sex age;
	var height;
	output out=sums sum=sum_height;
run;

data sums;
	set sums;
	if missing(sex) then sex="A";
	if missing(age) then age=-999;
run;

proc format;
	value $sexf "A"="All";
	value agef -999="All";
run;

proc report data=sums;
	column sex age,sum_height;
	define sex/group order=internal format=$sexf.;
	define age/across order=internal format=agef.;
	define sum_height/analysis sum;
run;
&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Nov 2017 15:41:03 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2017-11-09T15:41:03Z</dc:date>
    <item>
      <title>proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411925#M67371</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is a small&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have ;
input produit $ generation periode  measure $ value FLAG_REAL_PREV $ ;
datalines ;
A 2008 201710 nborder 810 R
A 2008 201710 sales 801000 R
A 2008 201709 nborder 809 R
A 2008 201709 sales 80900 R
A 2009 201710 nborder 910 R
A 2009 201710 sales 901000 R
A 2009 201709 nborder 909 R
A 2009 201709 sales 90900 R
A 2008 201710 nborder 8102 P
A 2008 201710 sales 8010002 P
A 2008 201709 nborder 8092 P
A 2008 201709 sales 809002 P
A 2009 201710 nborder 9102 P
A 2009 201710 sales 9010002 P
A 2009 201709 nborder 9092 P
A 2009 201709 sales 909002 P
;

proc report data= have ;
column produit generation measure periode , FLAG_REAL_PREV , value ;
define PRODUIT / group '' ;
	define generation / group order =  DATA ; 
	define measure / group '' style(column)={CELLWIDTH = 2.5in} style(header)={CELLWIDTH = 2.5in} format= $f_measure_label. ;
	define periode / across '' ;
	define FLAG_REAL_PREV / '' across  ;
		define value / '' ;
Run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;dataset with dummy datas. And this is my proc report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I need is to add a total of the key figure "sales" and for columns "R" (real) and "P" (forecast).&lt;/P&gt;&lt;P&gt;thanks a lot in advance for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nasser&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 13:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411925#M67371</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-11-09T13:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411940#M67377</link>
      <description>&lt;P&gt;I would run PROC SUMMARY which creates the totals and the amounts in each cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I would use PROC REPORT to create the table from the PROC SUMMARY output.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 14:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411940#M67377</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-11-09T14:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411944#M67379</link>
      <description>&lt;P&gt;Thanks Page,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I succeeded to create a new dataset that hold a column "valueTotal" (via proc summary)&lt;/P&gt;&lt;P&gt;but I don't know how to display it in the header of the report (via proc report)&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 14:39:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411944#M67379</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-11-09T14:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411966#M67380</link>
      <description>&lt;P&gt;I don't know what you mean by "in the header"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To me, that's just the first row of the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you did PROC SUMMARY properly, it does the calculations, including the "header" sum, and then PROC REPORT just takes the output from PROC SUMMARY and formats into a nice readable table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a simple example using SASHELP.CLASS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc summary data=sashelp.class;
    class sex age;
	var height;
	output out=sums sum=sum_height;
run;

data sums;
	set sums;
	if missing(sex) then sex="A";
	if missing(age) then age=-999;
run;

proc format;
	value $sexf "A"="All";
	value agef -999="All";
run;

proc report data=sums;
	column sex age,sum_height;
	define sex/group order=internal format=$sexf.;
	define age/across order=internal format=agef.;
	define sum_height/analysis sum;
run;
&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2017 15:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/411966#M67380</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-11-09T15:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412022#M67386</link>
      <description>&lt;P&gt;Ok Paige&lt;/P&gt;&lt;P&gt;My need was not clearly specified. please take a look at my screen shot&lt;/P&gt;&lt;P&gt;I would like to obtain the detail (yellow )&amp;nbsp; and the total (in red)&lt;/P&gt;&lt;P&gt;thanks Paige&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 16:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412022#M67386</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-11-09T16:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412026#M67387</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 566px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16553iD103F3DE3507BFFE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 16:58:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412026#M67387</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-11-09T16:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412058#M67391</link>
      <description>&lt;P&gt;My code produces a similar report using SASHELP.CLASS, you have to modify it for your exact needs.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 18:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412058#M67391</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-11-09T18:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc report add total of amount in the header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412248#M67394</link>
      <description>&lt;P&gt;Hello Paige,&lt;/P&gt;&lt;P&gt;thanks !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have many products A, B and C. is it possible to have a sub total by product ?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2017 09:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-report-add-total-of-amount-in-the-header/m-p/412248#M67394</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2017-11-10T09:16:32Z</dc:date>
    </item>
  </channel>
</rss>

