Once your data has been grouped (as described in Analyse data by grouping columns), you can display sub-totals and other calculations on the groups. You do this with (from the Data Display window) Tools > Group Calculations (Ctrl+K).
Note: this function is only available once your data has been grouped. You cannot display totals or sub-totals if the data has not been grouped.
The Group Calculations window allows you to display a number of different statistics. These will appear in either the Group Header or Group Footer of the display grouping.
The values appearing in the Group Header will be visible when the display grouping has been collapsed - it can be useful to have some statistics displayed in this.
The Group Calculations window shows you all the columns in the table:
Once you have created some group calculations, and have set up the data display in the way you want, you can save the layout with View > Save Layout. When you save the layout, this includes grouping and group calculations. This layout can be re-applied to the table at a later time. For more on this, see Saving / retrieving the display Layout.
In order for this function to work correctly for numeric columns, you need to set Options > Display Options > Use Grid formatting for Numeric columns. When this option is set, numeric columns are defined to the grid as being numeric (when the option is not set, all grid-columns are defined as character). This is required for sub-totalling of numeric values to work correctly.