Jump to content
  • How to Sort a CrossTable Visualization in Spotfire® Using IronPython Scripting


    Below is a sample script on how to sort the cross table visualization.

    Introduction

    Below is a sample script on how to sort the cross table visualization.

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    from Spotfire.Dxp.Application.Visuals import *
    from Spotfire.Dxp.Data import *
    #Add a script parameter 'vis' referring the cross table visualizations
    ctable=vis.As[CrossTablePlot]()
    #select how to sort rows
    ctable.SortRowsCategory = CategoryKey('Other')
    #To sort the cross table in descending
    ctable.SortRowsOrder=SortOrder.Descending
    ctable.SortRowsMode=CrossTablePlot.SortMode.Global
    
    #Select how to sort columns
    ctable.SortColumnsCategory = CategoryKey('WE')
    #To sort the cross table in descending
    ctable.SortColumnsOrder=SortOrder.Descending
    #To sort the cross table in Ascending
    #ctable.SortRowsOrder=SortOrder.Ascending

    References

    License:  TIBCO BSD-Style License

    Back to IronPython Scripting in Spotfire® Examples


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...