2.2.5.4.9.4 Nesting

This section applies to both the row axis (section 2.2.5.4.9.2) and column axis (section 2.2.5.4.9.3) unless otherwise specified. Within this section, axis means the row axis (section 2.2.5.4.9.2) or the column axis (section 2.2.5.4.9.3) as appropriate; fields means pivot fields (section 2.2.5.4.3), the data field (section 2.2.5.4.9.5.2), or both on the axis; area means the in row area (section 2.2.5.4.10.1.1) and column area (section 2.2.5.4.10.1.2) as appropriate; items means pivot items (section 2.2.5.4.4) or data items (section 2.2.5.4.9.5.1) as appropriate.

The axes specify an order that the fields are represented in the areas, see the PivotTable layout section for more information about the areas. Pivot lines (section 2.2.5.4.10.3) within the areas have references to items. Usually a pivot line (section 2.2.5.4.10.3) including an item of an outer field only includes items in the inner fields that exist with the item of the outer field in the source data (section 2.2.5.3.2), subject to the filtering on the PivotTable view. Usually all the instances of an item in the area are grouped together, with grouping on the outer fields taking precedence over grouping on the inner fields. This process is called nesting.

A nested item group is specified to be the contiguous set of pivot lines (section 2.2.5.4.10.3) that have the same item in an outer field.

The following example shows nested item groups for Country, State and City.

Country

State

City

USA

Illinois

Chicago

USA

Illinois

Springfield

USA

Louisiana

New Orleans

USA

Louisiana

Baton Rouge

Mexico

Jalisco

Guadalajara

The first two lines are a nested item group for Illinois. The next two lines are a nested item group for Louisiana. The first four lines are a nested item group for USA. The last line is both a nested item group for Jalisco and Mexico. Note that often in a PivotTable report (section 2.2.5) the repeated item labels will be omitted.

For an OLAP PivotTable view (section 2.2.5.4.2), nesting can be the result of either:

  • Items in the inner field that are in a different pivot hierarchy (section 2.2.5.4.5), or,

  • Items in an inner pivot field that is associated with the same pivot hierarchy (section 2.2.5.4.5) and that are child OLAP members.