Jump to content
  • How to Apply Multi-select values from a property control to a filter using IronPython in Spotfire®


    This article explains how to use an IronPython script to read multiple selected values from a Listbox Property control and apply the filter with the same.

    Introduction

    This article shows how to use an IronPython script to read multiple selected values from a Listbox Property control and apply the filter with the same.

    Code sample

    # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Application import Filters 
    from Spotfire.Dxp.Application.Filters import CheckBoxFilter
    
    myDataTable = Document.Data.Tables["World Bank Data"]
    FilterSelection = Document.Data.Filterings["Filtering example"]
    CheckBoxFilter = Document.FilteringSchemes[FilterSelection][myDataTable]["Region"].As[CheckBoxFilter]()
    
    CheckBoxFilter.IncludeEmpty = False
    print Document.Properties['MyRegion']
    mySelection = Document.Properties["MyRegion"]
    for val in mySelection:
        CheckBoxFilter.Check(val)
     

    References

    API Reference: Spotfire Analyst

     

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...