<?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 Adding a sum to a Graph Title in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-sum-to-a-Graph-Title/m-p/23000#M3596</link>
    <description>I currently have a graph where I have broken expenditures down by month.  What I am looking to do is add the current sum of all expenditures into the graph title.&lt;BR /&gt;
&lt;BR /&gt;
I have been trying to use %sysfunc(sum(&lt;COLUMN name=""&gt;), so far unsuccessfully.&lt;BR /&gt;
&lt;BR /&gt;
Should sysfunc work in this application?  If not is there a way to do this?&lt;/COLUMN&gt;</description>
    <pubDate>Wed, 04 Jun 2008 19:10:44 GMT</pubDate>
    <dc:creator>BillS</dc:creator>
    <dc:date>2008-06-04T19:10:44Z</dc:date>
    <item>
      <title>Adding a sum to a Graph Title</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-sum-to-a-Graph-Title/m-p/23000#M3596</link>
      <description>I currently have a graph where I have broken expenditures down by month.  What I am looking to do is add the current sum of all expenditures into the graph title.&lt;BR /&gt;
&lt;BR /&gt;
I have been trying to use %sysfunc(sum(&lt;COLUMN name=""&gt;), so far unsuccessfully.&lt;BR /&gt;
&lt;BR /&gt;
Should sysfunc work in this application?  If not is there a way to do this?&lt;/COLUMN&gt;</description>
      <pubDate>Wed, 04 Jun 2008 19:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-sum-to-a-Graph-Title/m-p/23000#M3596</guid>
      <dc:creator>BillS</dc:creator>
      <dc:date>2008-06-04T19:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a sum to a Graph Title</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-sum-to-a-Graph-Title/m-p/23001#M3597</link>
      <description>Hi, Bill:&lt;BR /&gt;
   %SYSFUNC will allow you to use DATA step functions. However, it seems to me that %SYSFUNC is the wrong function to use in this context. &lt;BR /&gt;
A very frequent use of  %SYSFUNC is something more like this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  title "Today is: %sysfunc(today(),mmddyy10.)";&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
For what you want to do, you will have to get the summary number via another method (other than %SYSFUNC). The program below gets the average age of all the students in SASHELP.CLASS, by using PROC SQL and SELECT-INTO to create a macro variable which contains the average. Then, subsequent program steps can use that average in a TITLE statement (or in other statements). I just used a PROC PRINT instead of PROC GCHART, but you would be able to use the same technique with the Graph procedures. You just need to create a macro variable that holds your SUM -- before you use that macro variable in a TITLE statement.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select mean(age) format=5.2 into :avgage &lt;BR /&gt;
    from sashelp.class;&lt;BR /&gt;
quit;&lt;BR /&gt;
                  &lt;BR /&gt;
%let avgage = &amp;amp;avgage; &lt;BR /&gt;
%put overall average age is: &amp;amp;avgage;&lt;BR /&gt;
                   &lt;BR /&gt;
proc print data=sashelp.class;&lt;BR /&gt;
  title "Today is: %sysfunc(today(),mmddyy10.)";&lt;BR /&gt;
  title2 "The Average Age is &amp;amp;avgage";&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 05 Jun 2008 02:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Adding-a-sum-to-a-Graph-Title/m-p/23001#M3597</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-06-05T02:07:19Z</dc:date>
    </item>
  </channel>
</rss>

