Jump to content
  • How to Create a Data Table based on Filtered Rows of another Data Table in Spotfire® Using IronPython Scripting


    Below is a code snippet on how to create a new data table based on the filtered rows of another data table

    Introduction

    Below is a code snippet on how to create a new data table based on the filtered rows of another data table

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import DataFlowBuilder
    from Spotfire.Dxp.Data.Import import DataTableDataSource
    from Spotfire.Dxp.Data import*
    #source table name
    tableName=Document.Properties["example"]
    dt = Document.Data.Tables[tableName]
    
    
    dataSelection=Document.ActiveFilteringSelectionReference
    ds=DataTableDataSource(Document.Data.Tables[tableName],dataSelection)
    dfb=DataFlowBuilder(ds,Application.ImportContext)
    context = Document
    
    flow=dfb.Build()
    #add data table
    Document.Data.Tables.Add("Output Table",flow)
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...