sort_by method

sort_by

Sorts this pivot field.

def sort_by(self, sort_type, field_sorted_by):
    ...
ParameterTypeDescription
sort_typeSortOrderThe type of sorting this field.
field_sorted_byintThe index of pivot field sorted by.
-1 means sorting by data labels of this field, others mean the index of data field sorted by.

sort_by

Sorts this pivot field.

def sort_by(self, sort_type, field_sorted_by, data_type, cell_name):
    ...
ParameterTypeDescription
sort_typeSortOrderThe type of sorting this field.
field_sorted_byintThe index of pivot field sorted by.
-1 means sorting by data labels of this field, others mean the index of data field sorted by.
data_typePivotLineTypeThe type of data sorted by.
cell_namestrSort by values in the row or column

See Also