Jump to content
  • How to add a Hierarchy Column to Data Table in Spotfire® using IronPython Scripting

    Code sample script to add a Hierarchy column to an existing table


    Below is a sample script on how to add a Hierarchy column to an existing table

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    from Spotfire.Dxp.Data import *
    from System.Collections.Generic import List
    table=Document.Data.Tables["Data Table"]
    #list of expressions and Add a Expression
    expressions.Add(" [Continent]")
    #define HierarchyDefinition
    definition=HierarchyDefinition(HierarchyNestingMode.Nested,expressions )
    #add column
    table.Columns.AddHierarchyColumn("New Hierarchy Column",definition)


    License:   TIBCO BSD-Style License



    User Feedback

    Recommended Comments

    There are no comments to display.

  • Create New...