<?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 in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/proc-report/m-p/484845#M16709</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I am using PROC REPORT to create a report on a table I created using PROC SQL. Everything is working fine, however I am trying to determine how to populate the last cell. Here is my current code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
create table tbl_AP as 
	select
		Grll,
		count(PI) as Total,
		count (AR) as Inis,
		calculated Inis / Calculated Total as Return_Rate
from db.&lt;BR /&gt;	where GROUP= 3
	group by Grll;
quit;


proc report data= tbl_AP
			headline headskip;
	Title1 "Distribution of People";
	column ('Groups' Grll) ('Employees' Total Inis) ('Return Rate' Return_Rate);
		define Gll / display 'Gr-Level';
		define Total / sum;
		define inis / sum;
		define Return_Rate/ display '%' format=percent8.1;
		rbreak after /dol skip summarize;
		compute after;
			Grll = 'Total';
		endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The entire table prints correctly, however the last row (the totals row) leaves a blank where the return rate column is calculated. Here is a partial snippet, however I am unable to insert the entire table output due to privacy policies.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snipps.PNG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22309i3062D0473A5E340E/image-size/small?v=v2&amp;amp;px=200" role="button" title="snipps.PNG" alt="snipps.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Aug 2018 18:02:10 GMT</pubDate>
    <dc:creator>JibJam221</dc:creator>
    <dc:date>2018-08-07T18:02:10Z</dc:date>
    <item>
      <title>proc report</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-report/m-p/484845#M16709</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I am using PROC REPORT to create a report on a table I created using PROC SQL. Everything is working fine, however I am trying to determine how to populate the last cell. Here is my current code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
create table tbl_AP as 
	select
		Grll,
		count(PI) as Total,
		count (AR) as Inis,
		calculated Inis / Calculated Total as Return_Rate
from db.&lt;BR /&gt;	where GROUP= 3
	group by Grll;
quit;


proc report data= tbl_AP
			headline headskip;
	Title1 "Distribution of People";
	column ('Groups' Grll) ('Employees' Total Inis) ('Return Rate' Return_Rate);
		define Gll / display 'Gr-Level';
		define Total / sum;
		define inis / sum;
		define Return_Rate/ display '%' format=percent8.1;
		rbreak after /dol skip summarize;
		compute after;
			Grll = 'Total';
		endcomp;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The entire table prints correctly, however the last row (the totals row) leaves a blank where the return rate column is calculated. Here is a partial snippet, however I am unable to insert the entire table output due to privacy policies.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snipps.PNG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22309i3062D0473A5E340E/image-size/small?v=v2&amp;amp;px=200" role="button" title="snipps.PNG" alt="snipps.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 18:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-report/m-p/484845#M16709</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2018-08-07T18:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-report/m-p/484869#M16710</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; I don't know if this is the best area for your post (this is for graphics), but I think I have a simple solution for your issue.&amp;nbsp; I don't know how well RBREAK works outside of the listing destination, but I don't think you even need to use PROC REPORT in this case:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
create table tbl_AP as 
	select
		Grll,
		count(PI) as Total,
		count (AR) as Inis,
		calculated Inis / Calculated Total as Return_Rate
from db.	where GROUP= 3
	group by Grll

       OUTER UNION CORR
       select 'Total' as grll,sum(total) as total,sum(inis) as inis,sum(return_rate) as return_rate&lt;BR /&gt;          from (select Grll,
		count(PI) as Total,
		count (AR) as Inis,
		calculated Inis / Calculated Total as Return_Rate
from db.	where GROUP= 3&lt;BR /&gt;        group by grll)&lt;BR /&gt; ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OUTER UNION CORR matches columns by their variable names.&amp;nbsp; I take your original query and add it as an inline view for the second query and then aggregate across that using SQL.&amp;nbsp; I don't know how you wanted return_rate to be aggregated (sum, mean, etc.) so you can change that as needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all you wanted for the total row was to do the same query without grouping you would do the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
create table tbl_AP as 
	select
		Grll,
		count(PI) as Total,
		count (AR) as Inis,
		calculated Inis / Calculated Total as Return_Rate
from db.	where GROUP= 3
	group by Grll

       OUTER UNION CORR
       select 'Total' as Grll,
		count(PI) as Total,
		count (AR) as Inis,
		calculated Inis / Calculated Total as Return_Rate
from db.	where GROUP= 3
 ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Aug 2018 18:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-report/m-p/484869#M16710</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2018-08-07T18:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc report</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/proc-report/m-p/484882#M16712</link>
      <description>&lt;P&gt;DISPLAY variables aren't summarized. And the fun part is none of the basic summary functions work properly with percentages (or other rates) unless the denominators are exactly the same for each group.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 19:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/proc-report/m-p/484882#M16712</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-07T19:47:32Z</dc:date>
    </item>
  </channel>
</rss>

