
## sort_by(self, sort_type, field_sorted_by) {#aspose.cells.SortOrder-int}

Sorts this pivot field.



```python

def sort_by(self, sort_type, field_sorted_by):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| sort_type | aspose.cells.SortOrder | The type of sorting this field. |
| field_sorted_by | int | The index of pivot field sorted by.<br/>-1 means sorting by data labels of this field, others mean the index of data field sorted by. |


## sort_by(self, sort_type, field_sorted_by, data_type, cell_name) {#aspose.cells.SortOrder-int-aspose.cells.pivot.PivotLineType-System.String}

Sorts this pivot field.



```python

def sort_by(self, sort_type, field_sorted_by, data_type, cell_name):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| sort_type | aspose.cells.SortOrder | The type of sorting this field. |
| field_sorted_by | int | The index of pivot field sorted by.<br/>-1 means sorting by data labels of this field, others mean the index of data field sorted by. |
| data_type | aspose.cells.pivot.PivotLineType | The type of data sorted by. |
| cell_name | System.String | Sort by values in the row or column |



### See Also
* module [`aspose.cells.pivot`](../../)
* class [`PivotField`](/cells/python-net/aspose.cells.pivot/pivotfield)
