Totals for Nested Tables
Since totals can be applied to categorical variables at any level of the nesting, you can create tables that contain group totals at multiple nesting levels.
Totals for categorical variables nested within other categorical variables represent group totals.
- Open the table builder (Analyze menu, Tables, Custom Tables).
- Drag and drop Gender to the left of Age category on the canvas pane.
- Right-click Age category on the canvas pane and choose Categories
and Totals from the pop-up menu.
Before creating the table, let's move the totals back below the totaled categories.
- In the Totals and Subgroups Appear group, select Below categories to which they apply.
- Click Apply to save the setting and return to the table builder.
- Click OK to create the table.
The table now displays two group totals: one for males and one for females.
Totals applied to nested variables are always group totals, not grand totals. If you want totals for the entire table, you can apply totals to the variable at the outermost nesting level.
- Open the table builder again (Analyze menu, Tables, Custom Tables).
- Right-click Gender on the canvas pane and choose Categories and Totals from the pop-up menu.
- Select (click) Total in the Categories and Totals dialog box.
- Click Apply and then click OK in the table builder to create the table.
Notice that the grand total is only 2,107, not 2,828. Two age categories are still excluded from the table, so the cases in those categories are excluded from all totals.