2.2.5.3.2.1 Pivot Field Sorting

Pivot items (section 2.2.5.3.3) of a pivot field (section 2.2.5.3.2) appear in the PivotTable view (section 2.2.5.3) in a specific order. This sort order (2) is only applicable to pivot fields in the row axis or column (1) axis and can be based on the following entities:

  • The values of the pivot items associated with the pivot field (section 2.2.5.3.2).

  • The values of the data items (section 2.2.5.3.7.5.1) that correspond to the pivot items associated with the pivot field

  • The values of the pivot items (section 2.2.5.3.3) of a pivot field (section 2.2.5.3.2) associated with an OLAP member property. See member properties for more details.

  • The ordering of the pivot items associated with the pivot field as determined by the source data (section 2.2.5.2.1) provider.

  • The ordering of instances of the sequence of the records that conform to the SXVI rule (as defined in section 2.1.7.40) for the pivot field within the file.

The sort order (2) of a pivot field (section 2.2.5.3.2) is specified by the fAutoSort field of the BrtBeginSXVD (section 2.4.272) record. If fAutoSort is equal to 1, then the sort is performed every time the PivotTable (section 2.2.5) is recalculated.

If the fAutoSort field of the BrtBeginSXVD record is equal to 1, the sort order (2) is specified by the value of the fAscendSort field of the BrtBeginSXVD record which determines whether the sort is ascending or descending.

The existence of a BrtBeginAutoSortScope (section 2.4.9) record following the BrtBeginSXVD record specifies the scope of the sort, as specified in the following table.

BrtBeginAutoSortScope existence

Meaning

Does not exist

Sorting is based on the values of the pivot items (section 2.2.5.3.3) of the pivot field (section 2.2.5.3.2).

Exists

Sorting is either based on the values in the data area (section 2.2.5.3.8.1.4) or on the values of member properties associated with the pivot field as specified by the sequence of records that conform to the PIVOTRULE rule (as defined in section 2.1.8) in the sequence of records that conform to the AUTOSORTSCOPE rule (as defined in section 2.1.7.40).

If the fAutoSort field of the BrtBeginSXVD (section 2.4.272) record is equal to 0, the sort order (2) is determined by the order of instances of the sequence of the records that conform to the SXVI rule for this pivot field.

For OLAP PivotTables, if the fTensorSort field of the BrtBeginSXVD record is equal to 1, the sort order (2) is determined by the OLAP source data (section 2.2.5.2.1) provider.