<?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 ExcelXP tagset with Proc Tabulate in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ExcelXP-tagset-with-Proc-Tabulate/m-p/7232#M2720</link>
    <description>I think there is a feature with the ExcelXP tagset with Proc Tabulate that makes nice reports but merges cells in a way that makes working with the data in Excel difficult.&lt;BR /&gt;
&lt;BR /&gt;
The example from the paper "ODS MARKUP: The SAS® Reports You've Always Dreamed Of" by Eric A. Gebhart has a example that combines tables in one sheet, which is exactly what I wanted to do.  I used this approack and created very nice reports, but when I tried to pass the data to Chart, the data in the first row was in in the header row.  &lt;BR /&gt;
&lt;BR /&gt;
This example illustrated my problem. (from page 14 in Eric's paper) &lt;BR /&gt;
&lt;BR /&gt;
This is what the table looks like&lt;BR /&gt;
                                                     Predicted     Actual&lt;BR /&gt;
Region   Division      Product Type       &lt;BR /&gt;
East      Consumer   Furniture          cell 1,1        cell 1,2&lt;BR /&gt;
                              Office               cell 2,1        cell 2,2&lt;BR /&gt;
&lt;BR /&gt;
These are the cells that contain the data, &lt;BR /&gt;
&lt;BR /&gt;
                                                     Predicted     Actual&lt;BR /&gt;
Region   Division      Product Type     cell 1,1        cell 1,2&lt;BR /&gt;
East      Consumer   Furniture   &lt;BR /&gt;
                              Office                cell 2,1        cell 2,2&lt;BR /&gt;
&lt;BR /&gt;
The XML shows this for the rows in question (I added breaks to show the data)&lt;BR /&gt;
&lt;BR /&gt;
&lt;ROW height="18"&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
                 &lt;DATA type="String"&gt;Region&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
                &lt;DATA type="String"&gt;Division&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
              &lt;DATA type="String"&gt;Product type&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL mergedown="1" styleid="m23658126"&gt;&lt;BR /&gt;
                   &lt;DATA type="Number"&gt;11081&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL mergedown="1" styleid="m23658136"&gt;&lt;BR /&gt;
                   &lt;DATA type="Number"&gt;12483&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
&lt;/ROW&gt;&lt;BR /&gt;
&lt;ROW height="18"&gt;&lt;BR /&gt;
    &lt;CELL mergedown="2" styleid="m23658146"&gt;&lt;BR /&gt;
                  &lt;DATA type="String"&gt;EAST&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL mergedown="1" styleid="m23658156"&gt;&lt;BR /&gt;
                  &lt;DATA type="String"&gt;CONSUMER&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
                 &lt;DATA type="String"&gt;FURNITURE&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
&lt;/ROW&gt;&lt;BR /&gt;
&lt;BR /&gt;
Does anyone know if there is a way to stop merging the data cells?&lt;BR /&gt;
Thanks &lt;BR /&gt;
Ed</description>
    <pubDate>Fri, 29 Feb 2008 21:28:24 GMT</pubDate>
    <dc:creator>EdB</dc:creator>
    <dc:date>2008-02-29T21:28:24Z</dc:date>
    <item>
      <title>ExcelXP tagset with Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ExcelXP-tagset-with-Proc-Tabulate/m-p/7232#M2720</link>
      <description>I think there is a feature with the ExcelXP tagset with Proc Tabulate that makes nice reports but merges cells in a way that makes working with the data in Excel difficult.&lt;BR /&gt;
&lt;BR /&gt;
The example from the paper "ODS MARKUP: The SAS® Reports You've Always Dreamed Of" by Eric A. Gebhart has a example that combines tables in one sheet, which is exactly what I wanted to do.  I used this approack and created very nice reports, but when I tried to pass the data to Chart, the data in the first row was in in the header row.  &lt;BR /&gt;
&lt;BR /&gt;
This example illustrated my problem. (from page 14 in Eric's paper) &lt;BR /&gt;
&lt;BR /&gt;
This is what the table looks like&lt;BR /&gt;
                                                     Predicted     Actual&lt;BR /&gt;
Region   Division      Product Type       &lt;BR /&gt;
East      Consumer   Furniture          cell 1,1        cell 1,2&lt;BR /&gt;
                              Office               cell 2,1        cell 2,2&lt;BR /&gt;
&lt;BR /&gt;
These are the cells that contain the data, &lt;BR /&gt;
&lt;BR /&gt;
                                                     Predicted     Actual&lt;BR /&gt;
Region   Division      Product Type     cell 1,1        cell 1,2&lt;BR /&gt;
East      Consumer   Furniture   &lt;BR /&gt;
                              Office                cell 2,1        cell 2,2&lt;BR /&gt;
&lt;BR /&gt;
The XML shows this for the rows in question (I added breaks to show the data)&lt;BR /&gt;
&lt;BR /&gt;
&lt;ROW height="18"&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
                 &lt;DATA type="String"&gt;Region&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
                &lt;DATA type="String"&gt;Division&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
              &lt;DATA type="String"&gt;Product type&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL mergedown="1" styleid="m23658126"&gt;&lt;BR /&gt;
                   &lt;DATA type="Number"&gt;11081&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL mergedown="1" styleid="m23658136"&gt;&lt;BR /&gt;
                   &lt;DATA type="Number"&gt;12483&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
&lt;/ROW&gt;&lt;BR /&gt;
&lt;ROW height="18"&gt;&lt;BR /&gt;
    &lt;CELL mergedown="2" styleid="m23658146"&gt;&lt;BR /&gt;
                  &lt;DATA type="String"&gt;EAST&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL mergedown="1" styleid="m23658156"&gt;&lt;BR /&gt;
                  &lt;DATA type="String"&gt;CONSUMER&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
    &lt;CELL styleid="s29"&gt;&lt;BR /&gt;
                 &lt;DATA type="String"&gt;FURNITURE&lt;/DATA&gt;&lt;/CELL&gt;&lt;BR /&gt;
&lt;/ROW&gt;&lt;BR /&gt;
&lt;BR /&gt;
Does anyone know if there is a way to stop merging the data cells?&lt;BR /&gt;
Thanks &lt;BR /&gt;
Ed</description>
      <pubDate>Fri, 29 Feb 2008 21:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ExcelXP-tagset-with-Proc-Tabulate/m-p/7232#M2720</guid>
      <dc:creator>EdB</dc:creator>
      <dc:date>2008-02-29T21:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: ExcelXP tagset with Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ExcelXP-tagset-with-Proc-Tabulate/m-p/7233#M2721</link>
      <description>Hi, Ed:&lt;BR /&gt;
  I wasn't sure whether you didn't want the spanning or whether you actively wanted the region and division to repeat on every row. Either way, with PROC REPORT, you can duplicate the TABULATE table and there is no spanning of rows. You can see from the PROC REPORT, that I have used NOPRINT with REGION and DIVISION in order to be able to show computed items PREG and PDIV on every row.&lt;BR /&gt;
 &lt;BR /&gt;
  I only did the worksheet for CANADA from Eric's example. Maybe this will help.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods path work.mytemp(update)&lt;BR /&gt;
         sasuser.templat(update)&lt;BR /&gt;
         sashelp.tmplmst(read);&lt;BR /&gt;
     &lt;BR /&gt;
proc template;&lt;BR /&gt;
  define style styles.XLStatistical;&lt;BR /&gt;
  parent = styles.Statistical;&lt;BR /&gt;
  style Header from Header /&lt;BR /&gt;
     borderwidth=2;&lt;BR /&gt;
  style RowHeader from RowHeader /&lt;BR /&gt;
     borderwidth=2&lt;BR /&gt;
     font_size=10pt;&lt;BR /&gt;
  style Data from Data /&lt;BR /&gt;
     borderwidth=2;&lt;BR /&gt;
end;&lt;BR /&gt;
run; &lt;BR /&gt;
    &lt;BR /&gt;
  &lt;BR /&gt;
data prdsale;&lt;BR /&gt;
set sashelp.prdsale;&lt;BR /&gt;
Difference = actual-predict;&lt;BR /&gt;
run;&lt;BR /&gt;
    &lt;BR /&gt;
proc sort data=prdsale; &lt;BR /&gt;
   by country region division year; &lt;BR /&gt;
run;&lt;BR /&gt;
        &lt;BR /&gt;
ods tagsets.excelxp file='ExcelXP_report_sample09.xls' &lt;BR /&gt;
                    style=XLStatistical&lt;BR /&gt;
            options(auto_subtotals='yes'&lt;BR /&gt;
            default_column_width='7, 10, 10, 7, 7'&lt;BR /&gt;
            frozen_rowheaders='yes'&lt;BR /&gt;
            sheet_interval='none'&lt;BR /&gt;
            sheet_name='Canada'&lt;BR /&gt;
            autofilter='all'&lt;BR /&gt;
            autofilter_table='2');&lt;BR /&gt;
*;&lt;BR /&gt;
* The output from the following two procs will be in a single worksheet&lt;BR /&gt;
* with a user-specified name of 'Canada'.&lt;BR /&gt;
*;&lt;BR /&gt;
   &lt;BR /&gt;
proc report data=prdsale nowd&lt;BR /&gt;
  style(summary)=RowHeader;&lt;BR /&gt;
  where country eq 'CANADA' and year eq 1993;&lt;BR /&gt;
  column region division preg pdiv prodtype predict actual;&lt;BR /&gt;
  define region/group noprint;&lt;BR /&gt;
  define division /group noprint;&lt;BR /&gt;
  define preg / computed 'Region'&lt;BR /&gt;
         style(column)=RowHeader;&lt;BR /&gt;
  define pdiv /computed 'Division'&lt;BR /&gt;
         style(column)=RowHeader;&lt;BR /&gt;
  define prodtype /group;&lt;BR /&gt;
  define predict /sum;&lt;BR /&gt;
  define actual / sum;&lt;BR /&gt;
  compute before region;&lt;BR /&gt;
    holdreg = region;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute before division;&lt;BR /&gt;
    holddiv = division;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute preg / character length=15;&lt;BR /&gt;
    preg = holdreg;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute pdiv / character length=15;&lt;BR /&gt;
    pdiv = holddiv;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  break after region / summarize;&lt;BR /&gt;
  rbreak after /summarize;&lt;BR /&gt;
  compute after region;&lt;BR /&gt;
    pdiv = 'Division Total';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
  compute after;&lt;BR /&gt;
    preg = 'Grand Total';&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run; &lt;BR /&gt;
   &lt;BR /&gt;
    &lt;BR /&gt;
&lt;BR /&gt;
proc print data=prdsale noobs label split='*';&lt;BR /&gt;
  where country eq 'CANADA' and year eq 1993;&lt;BR /&gt;
  id country region division;&lt;BR /&gt;
  var prodtype product quarter month year;&lt;BR /&gt;
  sum predict / style={tagattr='format:Currency'};&lt;BR /&gt;
  sum actual / style={tagattr='format:Currency'};&lt;BR /&gt;
  sum difference / style={tagattr='format:Currency formula:RC[-1]-RC[-2]'};&lt;BR /&gt;
  label prodtype = 'Product*Type'&lt;BR /&gt;
        predict = 'Predicted*Sales'&lt;BR /&gt;
        actual = 'Actual*Sales';&lt;BR /&gt;
run;  &lt;BR /&gt;
      &lt;BR /&gt;
ods tagsets.excelxp close;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 29 Feb 2008 22:30:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ExcelXP-tagset-with-Proc-Tabulate/m-p/7233#M2721</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-02-29T22:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: ExcelXP tagset with Proc Tabulate</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ExcelXP-tagset-with-Proc-Tabulate/m-p/7234#M2722</link>
      <description>Thanks Cynthia&lt;BR /&gt;
I want the spanning so that this looks like an Excel Pivot table.&lt;BR /&gt;
&lt;BR /&gt;
I was pretty sure that this could be done several ways, but the Tabulate seemed to do the trick with only a few lines of code. &lt;BR /&gt;
&lt;BR /&gt;
Thanks again for your help&lt;BR /&gt;
Ed</description>
      <pubDate>Mon, 03 Mar 2008 18:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ExcelXP-tagset-with-Proc-Tabulate/m-p/7234#M2722</guid>
      <dc:creator>EdB</dc:creator>
      <dc:date>2008-03-03T18:06:21Z</dc:date>
    </item>
  </channel>
</rss>

