Jump to content
  • How to add data table relations in Spotfire® using IronPython


    Code sample script to add relations between two data tables in an analysis.

    Introduction

    The following is a sample script to add relations between two data tables in an analysis.

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import DataRelation
    from Spotfire.Dxp.Data import DataRelationCollection
    from Spotfire.Dxp.Data import DataTableCollection
    
    
    # set the left and right tables
    tbl= Document.Data.Tables['tablename1']
    tbr= Document.Data.Tables['tablename2']
    
    # add the relation
    # "Region" is the column that relates the two tables
    Document.Data.Relations.Add(tbl, tbr,"[tablename1].[Region] = [tablename2].[Region]")
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...