Spotfire Apply Multi-select values from a property control to a filter using a script

I'm trying to figure out how to allow the user to select multiple values from a Property Control, and have those values passed to a filter.

The filtering needs to be conditional for two different related tables, so I have to use a list box tied to a property control, and handle the filtering with a script.

I have a current working version that allows for only one selection, but I need to be able to select multiple. I have included this DXP as an example.

 

The script I'm using to filter by 1 selection at a time is:

from Spotfire.Dxp.Application import Filters from Spotfire.Dxp.Application.Filters import CheckBoxFilter

Filter1=Document.FilteringSchemes[0].Item[myDataTable].Item[myDataTable.Columns.Item["Program_Name"]].AsCheckBoxFilter Filter2=Document.FilteringSchemes[0].Item[myDataTable2].Item[myDataTable2.Columns.Item["Program_Name"]].AsCheckBoxFilter

program=Document.Properties["SelectedProgram"]

Filter1.IncludeEmpty = False for value in Filter1.Values:
Filter1.Uncheck(value)

Filter2.IncludeEmpty = False for value in Filter2.Values:
Filter2.Uncheck(value)

if program == "All": Filter1.Check(program) Filter2.IncludeEmpty = False for value in Filter2.Values: Filter2.Check(value) if program <> "All": Filter1.Check(program) Filter2.Check(program)

 

Thanks!

 

 

Attachments

AttachmentSize
Binary Data sample.dxp57.09 KB

(1) Answer

Login