Skip to main content

Subtotals

Subtotals insert extra lines into a Matrix, placing them after each group of rows or columns sharing a common member of a particular dimension. Wherever one group ends, that's where the subtotal lines are placed.

For example, a dataset showing Sales by Region and Product, with a subtotal rule targeting the Region dimension, gets a North America total after the North America rows, and a South America total after the South America rows.

It has two parts:

  • Subtotal Rules — where the lines go and what they total. See Creating a Subtotal Rule.
  • An optional Block Format — replaces the default line with one you design, for example to add "Total" wording or a highlight. See Using a Block Format.

By default, each line holds a SUM formula that totals its group, ignoring any nested subtotals so nothing is counted twice. See how-subtotals-are-calculated.

note

Subtotals are available on Dataset spaces in the Matrix widget only.

Subtotals vs. Block Formatting​

Both features insert lines into the grid, but they decide where in different ways:

  • Block Formatting inserts a line wherever a condition you write is true.
  • Subtotals insert a line at the end of a group sharing a common member: wherever it changes from one member to the next. There's no condition to write.

To total groups of members, use Subtotals. To style or insert lines based on some other condition, use Block Formatting.

In this section​