O'Reilly logo

The Little SAS® Book for Enterprise Guide® 4.1 by Lora D. Delwiche, Susan J. Slaughter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.7. Adding Subtotals to a Data Table

The previous section showed how you can create new columns that summarize all the rows in a data table. This section shows how to summarize all the rows that belong to a group. The steps are the same as adding a grand total, with the additional step of selecting a group column.

Here is a sample of the results from the previous section where the SUM_OF_AdDollars column contains the total of the AdDollars column. To calculate the total amount spent by each office instead of the grand total, all you need to do is add a group column to the query. Re-open the query by right-clicking the query icon in the Project Explorer or Project Designer and selecting Open. This opens the Query Builder window.

Summarizing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required