當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python Tableau Sort用法及代碼示例

Tableau Server Client (TSC)Sort的用法。

用法

sort(field, direction)

屬性

名字 說明
field 設置要排序的字段。這些字段在RequestOption 類中定義。
direction 排序方向,升序 (Asc) 或降序 (Desc)。這些選項在RequestOptions.Direction 類中定義。

示例


# create a new instance of a request option object
req_option = TSC.RequestOptions()

# add the sort expression, sorting by name and direction
req_option.sort.add(TSC.Sort(TSC.RequestOptions.Field.Name,
                             TSC.RequestOptions.Direction.Asc))
matching_workbooks, pagination_item = server.workbooks.get(req_option)

for wb in matching_workbooks:
    print(wb.name)

有關使用 Sort 類的信息,請參閱 Filter and Sort



相關用法


注:本文由純淨天空篩選整理自tableau.github.io大神的英文原創作品 Sort class。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。