当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。