2.2.5.3.7.4.1 Collapsing

Settings in the file format can specify that a pivot item (section 2.2.5.3.3) of an outer pivot field (section 2.2.5.3.2), rather than having nested pivot items of inner pivot fields, is collapsed. Usually when a pivot item on an outer pivot field is collapsed, it does not have a nested pivot item group and when it appears in a pivot line (section 2.2.5.3.8.3), the pivot items of the inner pivot fields for the collapsed pivot item do not appear in the pivot line.

In the example from section 2.2.5.3.7.4, if Illinois and Mexico were collapsed, the result might look like the following table:

Country/Region

State

City

USA

Illinois

USA

Louisiana

New Orleans

USA

Louisiana

Baton Rouge

Mexico

For a non-OLAP PivotTable view (section 2.2.5.3), the collapsed state is specified by the fHideDetail field of the BrtBeginSXVI (section 2.4.274) record.

For an OLAP PivotTable view, there are two types of collapsing: child collapsing and attribute hierarchy collapsing.

Child collapsing is when the child pivot items (section 2.2.5.3.3), corresponding to child OLAP members, of a pivot item corresponding to a parent OLAP member in an OLAP hierarchy are not shown.

If a pivot field (section 2.2.5.3.2) is the first pivot field of the pivot hierarchy (section 2.2.5.3.4) on the axis then the fDrilledLevel field of the BrtBeginSXVD (section 2.4.272) record of the pivot field MUST be 1.

If a pivot field is not the first pivot field of the pivot hierarchy on the axis and if the fDrilledLevel field of the BrtBeginSXVD record of the pivot field is 1, then there is no child collapsing for the preceding pivot field of the pivot hierarchy on the axis and the fDrilledMember field of the BrtBeginSXVI (section 2.4.274) records for the pivot items (section 2.2.5.3.3) of the preceding pivot field of the pivot hierarchy on the axis MUST be 0.

If a pivot field (section 2.2.5.3.2) is followed by another pivot field of the same pivot hierarchy on the axis, and the fDrilledLevel field of the BrtBeginSXVD record of the outer pivot field is equal to 0 and the fDrilledMember field of a BrtBeginSXVI record of the pivot item of the outer pivot field is 0, then the pivot item containing the BrtBeginSXVI record is collapsed using child collapsing.

Attribute hierarchy collapsing only occurs when an outer pivot field is associated with a pivot hierarchy (section 2.2.5.3.4) that is an attribute hierarchy, as specified by the fAttributeHierarchy field of the BrtBeginPCDHierarchy (section 2.4.146) record of the associated cache hierarchy (section 2.2.5.2.7), and the inner pivot field immediately following that outer pivot field is associated with a different pivot hierarchy that is an attribute hierarchy. In that case, if a pivot item (section 2.2.5.3.3) is attribute hierarchy collapsed, pivot items (section 2.2.5.3.3), corresponding to OLAP members, will not be shown for the inner pivot field. The attribute hierarchy collapsed state of a pivot item is specified by the fCollapsedMember field of the BrtBeginSXVI (section 2.4.274) record. The fItemsDrilledByDefault field of the BrtBeginSXVD (section 2.4.272) record provides a default value for pivot items of the pivot field.

For an OLAP PivotTable view (section 2.2.5.3), there can be pivot items from an inner pivot field (section 2.2.5.3.2) on the pivot line (section 2.2.5.3.8.3) if either the outer pivot field is collapsed and the inner pivot field and outer pivot field are in different pivot hierarchies (section 2.2.5.3.4) and attribute hierarchy collapsing is not being used or if the pivot items are member properties.