<?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 Text to Date Column Summary in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Text-to-Date-Column-Summary/m-p/691234#M24570</link>
    <description>&lt;P&gt;For the ODS EXCEL destination, in the COMPUTE AFTER block, you can use CALL DEFINE to place a formula in a cell via the STYLE=[TAGATTR= feature&lt;/P&gt;
&lt;PRE&gt;  compute after;
    call define ('_c1_', 'style', 'style=[tagattr=''formula:="Totals"'']');
  endcomp;&lt;/PRE&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data have;
  do date = '01-OCT2020'd to '04-OCT-2020'd;
    do contract = 1 to 3;
      legacy = contract + 1e6;
      do billdoc = 1 to 2;
        _n_ + 1;
        revenue_sum = 1000 + _n_ * 21;
        kw_sum = 100 + _n_ * 2;
        output;
      end;
    end;
  end;

 format revenue_sum dollar10.2 date mmddyy10.;
run;

ods excel file='report.xlsx';

proc report data=have
  spanrows 
  style(column)=[pretext="aaa "]
;
  columns date contract legacy billdoc revenue_sum kw_sum;
  define date / group;
  define contract / group;
  define legacy / group;
  define billdoc / group;
  
  break after date / summarize style=[background=lightgrey];
  rbreak after / summarize style=[fontsize=14pt];

  compute after;
    call define ('_c1_', 'style', 'style=[tagattr=''formula:="Totals"'']');
  endcomp;
run;

ods excel close;&lt;/PRE&gt;
&lt;P&gt;Excel image&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RichardADeVenezia_0-1602592636361.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50605i4B6F09F04B526EC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RichardADeVenezia_0-1602592636361.png" alt="RichardADeVenezia_0-1602592636361.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Oct 2020 12:38:39 GMT</pubDate>
    <dc:creator>RichardDeVen</dc:creator>
    <dc:date>2020-10-13T12:38:39Z</dc:date>
    <item>
      <title>Add Text to Date Column Summary</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Text-to-Date-Column-Summary/m-p/691174#M24569</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a ODS Excel SAS PROC report which has Date column and i am group on that column as well. However towards the end i want to add the text 'TOTALS' to this date column summary. But since the column is formatted as DATE it is not displaying the text field. Any inputs on how to achieve this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how my program looks like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc report data=CUST_REV_MONTHLY nowd spanrows 
style(report)=[bordercolor=black borderwidth=3pt]
style(header)=[verticalalign=middle backgroundcolor=cx4C7DC4 foreground=white]
style(summary)=[backgroundcolor=black foreground=white fontstyle=roman fontweight=bold bordercolor=black borderwidth=2pt]

;

	column pstng_dt contract lcontract billdocn stmt_amt_sum kwh_sum oper_amt_sum;

	define pstng_dt / f=mmddyy10. order=internal 'POSTING DATE' group style(column)=[vjust=middle just=left backgroundcolor=cx4C7DC4 fontweight=bold foreground=white];

	define contract / 'CONTRACT' group style(column)=[vjust=middle just=left backgroundcolor=cx4C7DC4 fontweight=bold foreground=white];
	define lcontract / 'LEGACY CONTRACT' group style(column)=[vjust=middle just=left backgroundcolor=cx4C7DC4 fontweight=bold foreground=white];
	define billdocn / 'BILL DOC NO' group style(column)=[vjust=middle just=left backgroundcolor=cx4C7DC4 fontweight=bold foreground=white];

	define stmt_amt_sum / 'STMT REV AMT' style(column)=[backgroundcolor = white tagattr='format:$#,##0.00;[Red]($#,##0.00);0.00;'] ;
	define kwh_sum / 'KWH USAGE' style(column)=[backgroundcolor = lightgrey];
	define oper_amt_sum / 'OPER REV AMT' style(column)=[backgroundcolor = cxABABAB tagattr='format:$#,##0.00;[Red]($#,##0.00);0.00;'] ;

	break after pstng_dt / summarize; /* Every time the pstng_dt Changes Summarize the table (SubTotal)*/

	compute after;
		pstng_dt = "TOTALS" ; /*When everything ends Add the literal 'Total' in the pstng_dt columns*/
	endcomp;

	rbreak after / summarize; /* Finally summarize the whole table (Grand Totals)*/

run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what im getting&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rajesh1980_0-1602579042940.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50597i957FD2D538B49073/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rajesh1980_0-1602579042940.png" alt="rajesh1980_0-1602579042940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how i want it&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rajesh1980_1-1602579132613.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50598iF8DF27F0D960994B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rajesh1980_1-1602579132613.png" alt="rajesh1980_1-1602579132613.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly Help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards..&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 08:52:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Text-to-Date-Column-Summary/m-p/691174#M24569</guid>
      <dc:creator>rajesh1980</dc:creator>
      <dc:date>2020-10-13T08:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Add Text to Date Column Summary</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Text-to-Date-Column-Summary/m-p/691234#M24570</link>
      <description>&lt;P&gt;For the ODS EXCEL destination, in the COMPUTE AFTER block, you can use CALL DEFINE to place a formula in a cell via the STYLE=[TAGATTR= feature&lt;/P&gt;
&lt;PRE&gt;  compute after;
    call define ('_c1_', 'style', 'style=[tagattr=''formula:="Totals"'']');
  endcomp;&lt;/PRE&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;data have;
  do date = '01-OCT2020'd to '04-OCT-2020'd;
    do contract = 1 to 3;
      legacy = contract + 1e6;
      do billdoc = 1 to 2;
        _n_ + 1;
        revenue_sum = 1000 + _n_ * 21;
        kw_sum = 100 + _n_ * 2;
        output;
      end;
    end;
  end;

 format revenue_sum dollar10.2 date mmddyy10.;
run;

ods excel file='report.xlsx';

proc report data=have
  spanrows 
  style(column)=[pretext="aaa "]
;
  columns date contract legacy billdoc revenue_sum kw_sum;
  define date / group;
  define contract / group;
  define legacy / group;
  define billdoc / group;
  
  break after date / summarize style=[background=lightgrey];
  rbreak after / summarize style=[fontsize=14pt];

  compute after;
    call define ('_c1_', 'style', 'style=[tagattr=''formula:="Totals"'']');
  endcomp;
run;

ods excel close;&lt;/PRE&gt;
&lt;P&gt;Excel image&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RichardADeVenezia_0-1602592636361.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50605i4B6F09F04B526EC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RichardADeVenezia_0-1602592636361.png" alt="RichardADeVenezia_0-1602592636361.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 12:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Text-to-Date-Column-Summary/m-p/691234#M24570</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-10-13T12:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add Text to Date Column Summary</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Text-to-Date-Column-Summary/m-p/691943#M24582</link>
      <description>Thank you very much sir!! It worked!</description>
      <pubDate>Thu, 15 Oct 2020 19:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Add-Text-to-Date-Column-Summary/m-p/691943#M24582</guid>
      <dc:creator>rajesh1980</dc:creator>
      <dc:date>2020-10-15T19:17:20Z</dc:date>
    </item>
  </channel>
</rss>

