<?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 Report: Computed fields in &amp;quot;Grand Total&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665744#M199105</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm am putting together a proc report for output to ODS Excel, which contains several computed fields, for example, "Price per Tonne", which as you can probably guess, is "Revenue" divided by "Tonnes".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to replicate this in&amp;nbsp;a summary row on my report, but using this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* Grand totals;&lt;/P&gt;
&lt;P&gt;rbreak after / summarize style(summary)={font_weight=bold&amp;nbsp; backgroundcolor=gwh&amp;nbsp; color=firebrick};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gives a total of the "Price per Tonne" column, and not the computation of Total Revenue / Total Tonnes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an option to continue use of the computed field into the summary/grand total row?&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;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jun 2020 10:53:41 GMT</pubDate>
    <dc:creator>Jim_Ogilvie</dc:creator>
    <dc:date>2020-06-29T10:53:41Z</dc:date>
    <item>
      <title>Proc Report: Computed fields in "Grand Total"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665744#M199105</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm am putting together a proc report for output to ODS Excel, which contains several computed fields, for example, "Price per Tonne", which as you can probably guess, is "Revenue" divided by "Tonnes".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to replicate this in&amp;nbsp;a summary row on my report, but using this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;* Grand totals;&lt;/P&gt;
&lt;P&gt;rbreak after / summarize style(summary)={font_weight=bold&amp;nbsp; backgroundcolor=gwh&amp;nbsp; color=firebrick};&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gives a total of the "Price per Tonne" column, and not the computation of Total Revenue / Total Tonnes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an option to continue use of the computed field into the summary/grand total row?&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;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 10:53:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665744#M199105</guid>
      <dc:creator>Jim_Ogilvie</dc:creator>
      <dc:date>2020-06-29T10:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Computed fields in "Grand Total"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665750#M199108</link>
      <description>Can you give an example ?&lt;BR /&gt;Try &lt;BR /&gt;&lt;BR /&gt;proc report data=sashelp.class nowd;&lt;BR /&gt;column name weight;&lt;BR /&gt;define name/display;&lt;BR /&gt;define weight/analysis sum;&lt;BR /&gt;compute after;&lt;BR /&gt;name='xxxx';&lt;BR /&gt;endcomp;&lt;BR /&gt;rbreak after/summarize;&lt;BR /&gt;run;</description>
      <pubDate>Mon, 29 Jun 2020 11:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665750#M199108</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-06-29T11:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Computed fields in "Grand Total"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665758#M199112</link>
      <description>&lt;P&gt;Sure Kevin:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="80.25%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="10%"&gt;&lt;STRONG&gt;Region&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="10%"&gt;&lt;STRONG&gt;Revenue&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="20%"&gt;&lt;STRONG&gt;Tonnes&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="20%"&gt;&lt;STRONG&gt;Have&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="20%"&gt;&lt;STRONG&gt;Want&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10%" class="lia-indent-padding-left-30px"&gt;Region A&lt;/TD&gt;
&lt;TD width="10%" class="lia-indent-padding-left-30px"&gt;2033.9&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;171024.7&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;84.1&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;84.1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10%" class="lia-indent-padding-left-30px"&gt;Region B&lt;/TD&gt;
&lt;TD width="10%" class="lia-indent-padding-left-30px"&gt;7236.7&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;626710.71&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;86.6&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;86.6&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="10%"&gt;&lt;STRONG&gt;Total&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="10%"&gt;&lt;STRONG&gt;9270.6&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;797735.41&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;170.7&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD width="20%" class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;86.1&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the above example, the 84,1 and 86.6 values are being computed. The "Have" column, shows my current output, the "Want" shows the desired output, which in Excel terms would be a copy-paste of the formula in the cell above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 11:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665758#M199112</guid>
      <dc:creator>Jim_Ogilvie</dc:creator>
      <dc:date>2020-06-29T11:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report: Computed fields in "Grand Total"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665768#M199113</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards expandtabs ;
input Region &amp;amp; $20. Revenue	Tonnes;
cards;
Region A	 2033.9	171024.7	
Region B	 7236.7	626710.71	
;
proc report data=have nowd;
column Region   Revenue	Tonnes want;
define Region/display;
define  Revenue/analysis sum;
define Tonnes/analysis sum;
define want/computed;
compute want;
 want=Tonnes.sum/ Revenue.sum;
endcomp;
compute after;
 Region='Total';
endcomp;
rbreak after/summarize;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jun 2020 11:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Report-Computed-fields-in-quot-Grand-Total-quot/m-p/665768#M199113</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-06-29T11:59:33Z</dc:date>
    </item>
  </channel>
</rss>

