2.2.5.4.9.4.1 Collapsing

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

If Illinois and Mexico were collapsed in the preceding table, the result might look like the following table.

Country

State

City

USA

Illinois

USA

Louisiana

New Orleans

USA

Louisiana

Baton Rouge

Mexico

For a non-OLAP PivotTable view (section 2.2.5.4.2), the collapsed state is specified by the fHideDetail field of the SXVI record (section 2.4.312).

For an OLAP PivotTable views(section 2.2.5.4.2), there are two types of collapsing: child collapsing and attribute hierarchy collapsing.

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

If a pivot field (section 2.2.5.4.3) is the first pivot field (section 2.2.5.4.3) of the pivot hierarchy (section 2.2.5.4.5) on the axis then the fDrilledLevel field of the SXVDTEx record (section 2.4.311) pivot field (section 2.2.5.4.3) MUST be 1.

If a pivot field (section 2.2.5.4.3) is not the first pivot field (section 2.2.5.4.3) of the pivot hierarchy (section 2.2.5.4.5) on the axis and if the fDrilledLevel field of the SXVDTEx record (section 2.4.311)of the pivot field (section 2.2.5.4.3) is 1, then there is no child collapsing for the preceding pivot field (section 2.2.5.4.3) of the pivot hierarchy (section 2.2.5.4.5) on the axis and the fDrilledMember field of the SXVIFlags structure (section 2.5.263) for the pivot items (section 2.2.5.4.4) of the preceding pivot field (section 2.2.5.4.3) of the pivot hierarchy (section 2.2.5.4.5) on the axis MUST be 0. If a pivot field (section 2.2.5.4.3) is followed by another pivot field (section 2.2.5.4.3) of the same pivot hierarchy (section 2.2.5.4.5) on the axis, and the fDrilledLevel field of the SXVDTEx record (section 2.4.311) of the inner pivot field (section 2.2.5.4.3) is equal to 0 and the fDrilledMember field of the SXVIFlags structure (section 2.5.263) of the pivot item (section 2.2.5.4.4) of the outer pivot field (section 2.2.5.4.3) is 0, then the pivot item (section 2.2.5.4.4) associated with the SXVIFlags structure (section 2.5.263) is collapsed using child collapsing.

Attribute hierarchy collapsing only occurs when a pivot field (section 2.2.5.4.3) is associated with a pivot hierarchy (section 2.2.5.4.5) that is an attribute hierarchy and the pivot field (section 2.2.5.4.3) immediately following that outer pivot field (section 2.2.5.4.3) is associated with a different pivot hierarchy (section 2.2.5.4.5) that is an attribute hierarchy. In that case, if a pivot item (section 2.2.5.4.4) is attribute hierarchy collapsed, pivot items (section 2.2.5.4.4), corresponding to OLAP members, will not be shown for the inner pivot field (section 2.2.5.4.3). The attribute hierarchy collapsed state of a pivot item (section 2.2.5.4.4) is specified by the fCollapsedMember flag of the SXVIFlags structure (section 2.5.263). The fItemsDrilledByDefault flag of the SXVDTEx record (section 2.4.311) provides a default value for pivot items (section 2.2.5.4.4) in the pivot field (section 2.2.5.4.3).

For an OLAP PivotTable view (section 2.2.5.4.2), there can be pivot items (section 2.2.5.4.4) for an inner pivot field (section 2.2.5.4.3) on the pivot line (section 2.2.5.4.10.3) if either the outer pivot field (section 2.2.5.4.3) is collapsed and the inner pivot field (section 2.2.5.4.3) and outer pivot field (section 2.2.5.4.3) are in different pivot hierarchies (section 2.2.5.4.5) and attribute hierarchy collapsing is not being used or if the pivot items (section 2.2.5.4.4) are member properties (section 2.2.5.4.6).