Including a Total or Subtotal

In this section:

To help you and others interpret the detailed information presented in a report, Report Painter enables you to summarize numeric information using column and row totals, grand totals, and subtotals. These summary lines may be used to clarify or highlight information in numeric or matrix reports.


Top of page

x
Calculating a Row or Column Total

How to:

You can add totals for rows or columns of numbers:



x
Procedure: How to Show/Hide Totals for All Columns
  1. Click the Options button on the Output Format toolbar. The Report Options dialog box opens at the Output tab.
  2. In the Totals box, click Column totals from the drop-down list to display a total for every column on the report.

    or

    Click No totals to hide the display of column totals.



x
Procedure: How to Apply Column Totals to Selected Fields
  1. From Report Painter, select the field in the report that you are applying the total to.
  2. Click Output from the Report menu.

    The Report Options dialog box opens at the Output tab.

  3. Click Column totals from the Apply to current columns in report drop-drown list.
  4. Click OK to close the Report Options dialog box.

    The column total appears in Report Painter, indicated by the word TOTAL, as shown in the following image.

  5. Right-click anywhere on the column total and click Options, as shown in the following image.

    Note: You may change the title for the column total by selecting Title.

    The Properties for Column Total dialog box opens at the Styling tab.

  6. Click the General tab of the Properties for Column Total dialog box.
  7. Select the check box next to the numeric value field(s) to be included in the column total, as shown in the following image.

    Note: Apply totals to all columns is selected by default.

  8. Click OK to close the Properties for Column Totals dialog box.

    The column total appears for the selected field(s).



x
Procedure: How to Show/Hide Row Totals
  1. Click the Options button on the Output Format toolbar. The Report Options dialog box opens at the Output tab.
  2. In the Totals box, click Show Row Totals to display a total for every row on the report.

    or

    Deselect Show Row Totals to hide the display of row totals.



x
Procedure: How to Style Column Totals and Row Totals

You may style column totals and row totals from the Report Options dialog box.

  1. After adding the column/row totals to your report, select Styling from the Report menu.

    The Report Options dialog box opens at the Style tab.

  2. Select the column/row total from the active object drop-down list.

    Note: The column/row totals appear as Column Totals, Row Totals (Report), Row Totals (Title), and Row Totals (Data), in the active object drop-down list, as shown in the following image.

    Tip: Column Totals may also be styled through the Column Total Properties dialog box. For more information, see Properties for Column Total Style Tab.

  3. Apply any styling to the selected column or row total active object and click Apply.
  4. Click OK to close the Report Options dialog box.

The following image is an example of a report with column/row total styling applied.


Top of page

x
Adding a Section Total or Grand Total to a Report

How to:

Frequently, reports contain detailed information that is broken down into subsections for which simple column and row totals do not provide adequate summaries. In these instances, it is more useful to look at subtotals for particular sections and a grand total at the end of the report.

In general, subtotals produce totals every time a specified sort field value changes. Report Painter provides several options for creating section subtotals and grand totals:

To further control when subtotals are produced, you can use the When option with any subtotaling command. Subtotal commands are independent of record selection phrases.



x
Procedure: How to Add a Subtotal
  1. Select the By sort field in the Report Painter window.
  2. Click the Subtotal button on the Columns toolbar.

    A Subtotal field appears in the Report Painter window indicated by the word *TOTAL.

  3. You can add to or type over *TOTAL.

Subtotal displays a total for columns containing numeric values only when a specified sort field changes values.



Example: Showing a Subtotal and a Total

The following report on employee salaries shows the total salary expense of each department, as well as a grand total for all departments.



x
Procedure: How to Add a Subtotal on Several Sort Levels
  1. Select the lowest level By sort field in the Report Painter window for which you want a total.
  2. Click Subtotal on all outer sort fields from the Insert menu.

    A Subtotal field appears in the Report Painter window indicated by the word *TOTAL.

  3. You can add to or type over *TOTAL.

Subtotal displays a total for columns containing numeric values when a specified sort field, and any preceding (higher level) sort field(s) change values.



x
Procedure: How to Suppress a Subtotal for One Item in a Sort Group
  1. Select the By subtotal object area in the Subtotal field window.
  2. Click Suppress for single lines from the Properties menu.

    or

    Right-click and select Suppress for single lines from the context menu.

Suppress for single lines displays subtotal lines only when the specified sort field contains more than one record.



x
Procedure: How to Add a Subtotal for a Computed Field
  1. Select the By sort field in the Report Painter window.
  2. Click Recompute from the Insert menu.

    A recomputed field appears in the Report Painter window of the report indicated by the word *TOTAL.

  3. You can add to or type over *TOTAL.

Recompute displays totals for columns containing numeric values, and recalculates temporary fields containing information, such as ratios using subtotals each time a specified sort field changes values.

For details about creating temporary fields in reports, see How to Create a Calculated Value.



x
Procedure: How to Add a Subtotal for a Computed Field on Several Sort Levels

To calculate a subtotal on a computed field when a specific sort field or a higher-level sort field changes:

  1. Select the lowest level By sort field in the Report Painter window for which you want a total.
  2. Click Recompute on all outer sort fields from the Insert menu.
  3. You can add to or type over this text.

Recomputes display totals for columns containing numeric values and recalculates temporary fields each time a specified sort field or preceding sort fields (higher levels) change values.



x
Procedure: How to Return a Default Title for the Object Area
  1. Select the subtotal field.
  2. Click Use Default Text from the Properties menu for the selected object area.

    or

    Right-click and select Use Default Text from the context menu.

The default title is returned to the object area.



x
Procedure: How to Suppress a Subtotal for a Field
  1. Right-click a column to which subtotaling has been applied and click Options from the context menu. The Field Properties dialog box opens.
  2. Click the General tab.
  3. In the Columns Subtotals box, deselect the Apply totals to all columns check box.


x
Procedure: How to Create a Subtotal Calculation

To use subtotal values in a calculation and display the result of the calculation (not the subtotal value) on the report:

  1. Select a By field in the Report Painter window.
  2. Click Recap from the Insert menu. The RECAP dialog box opens.
  3. Type a field name in the Field combo box.
  4. Type the format directly in the Format box or click the Format button to display the Format dialog box. For details, see Format Dialog Box.
  5. Enter a calculation in the window.

    Note: You can create multiple calculations and display their subtotal values in the report. To enter another calculation in the window, click the New button.

  6. Click OK.

Recap computes subtotals based on user-supplied calculations. New values appear each time the specified sort field value changes.


WebFOCUS