Sample 34506: How to Generate Row and Column Totals in SAS® Enterprise Guide
Overview
In SAS Enterprise Guide, you might want to summarize your data by row and column. This sample explains how you can easily do this by using the Summary Tables Wizard.
Create the Sample Data
To create the data used in this sample, submit the following code
in a code window:
data timerec;
input employee $ week $ phase $ hours;
cards;
Chen 11SEP89 Analysis 8
Chen 11SEP89 Analysis 7
Chen 11SEP89 Coding 2.5
Chen 11SEP89 Testing 8
Chen 11SEP89 Coding 8.5
Chen 11SEP89 Testing 6
Chen 11SEP89 Coding 4
Stewart 11SEP89 Coding 8
Stewart 11SEP89 Testing 4.5
Stewart 11SEP89 Coding 4.5
Stewart 11SEP89 Coding 10.5
Stewart 11SEP89 Testing 10
;
run;
|
Complete the Summary Wizard
- Select Describe ► Wizards ► Summary Tables to launch the Summary Tables Wizard.
- On the first wizard page, verify that the information is correct, and then click Next.
- On the second wizard page, add HOURS as the Analysis variable, and change the Statistics labels option to hidden
so that the label doesn't appear in the results. Click Next.
- On the third wizard page, add PHASE as the Columns variable, add EMPLOYEE as the
Rows variable, and add WEEK as the Pages (page by) variable. Click Next.
- On the fourth wizard page, accept Grand total only as the default for Columns, Rows, and Pages. Change the Page totals option to Last so that page totals will appear after the weekly tables. Click Next.
- On the fifth wizard page, choose whether to save the results to a data set, and then click Next.
- On the sixth wizard page, choose whether to customize the Table Titles and Footnote, and then click Finish to run the wizard.
Examine Results
The resulting table shows the number of hours each employee spent in each phase, as well as the number of hours spent in each phase by all employees.

Additional Documentation
For more information about SAS Enterprise Guide, see the SAS Enterprise Guide documentation page.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
In SAS Enterprise Guide, you might want to summarize your data by row and column. This sample explains how you can easily do this by using the Summary Tables Wizard.
| Date Modified: | 2009-01-22 11:49:19 |
| Date Created: | 2009-01-16 10:09:54 |
Operating System and Release Information
| SAS System | SAS Enterprise Guide | Microsoft® Windows® for x64 | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Advanced Server | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Datacenter Server | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Server | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows 2000 Professional | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows NT Workstation | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Datacenter Edition | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Enterprise Edition | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows Server 2003 Standard Edition | 4.1 | | 9.1 TS1M3 SP4 | |
| Microsoft Windows XP Professional | 4.1 | | 9.1 TS1M3 SP4 | |
| Windows Vista | 4.1 | | 9.1 TS1M3 SP4 | |