How to sort a column from a given data table in TIBCO Spotfire® using IronPython Scripting
Introduction
This article gives a code sample to sort a column from a given data table. Refer to the attached analysis file.
Code Sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Application.Visuals import TablePlot, TablePlotColumnSortMode table = tableVis.As[TablePlot]() #refers the required table visualization table.SortInfos.Clear() # clears all the existing sorting applied on the table table.SortInfos.Add(Document.Data.Tables["tableName"].Columns["columnName"], TablePlotColumnSortMode.Descending) #sorts the desired column taken from columnName parameter #Replace the 2nd parameter to sort the column in Ascending order #TablePlotColumnSortMode.Ascending
References
- API Reference: Spotfire Analyst
- API Reference: TablePlotBase.SortInfos Property
- API Reference: TableSortInfoCollection Class
- API Reference: TablePlotColumnSortMode Enumeration
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.