PivotLabels collection, CategoryItems collection
Sets a data value (rather than label) criterion in the sort conditions available in the Pivot and Chart sections. This method corresponds to the Sort by Values feature in the Pivot and Chart sections where the second list selection orders each value of the target item specified in the first list selection by its corresponding numeric value in the second list.
Expression.SortByFact(FactName As String,SortFunction As BqSortFunction, [optional]SortOrder As BqSortOrder)
An expression that returns a PivotLabelsTotals or CategoryItems collection
The BqSortFunction constant group contains these values:
The BqSortOrder constant group contains the bqSortAscend and bqSortDescend values.
This example shows how to sort the Product Name item by its corresponding numeric value Amount Sales:
ActiveDocument.Sections["Pivot2"].TopLabels["Product Name"].SortByFact("Amount Sales", bqSortFunctionSum, bqSortAscend)