Sunday, July 12, 2015

Get Visible Filters Information - Python Script


Below is the script to get details of Visible Filters from Filter Panel

 
import Spotfire.Dxp.Application.Filters as filters
from Spotfire.Dxp.Application.Filters import *


# Navigate through each page in the analyses
for eachPage in Document.Pages:
# Get the active data table in the current page
        activeTable = eachPage.ActiveDataTableReference
        print activeTable.Name
# Get the set of all table groups in the current page
        tableGroup = eachPage.FilterPanel.TableGroups
# Navigate through all the table groups in the filter panel of current page
        for t in tableGroup:
# To filter on the active data table used in the filter panel
                if (t.Name == activeTable.Name):
                        print t.Panel.FilteringSchemeReference.FilteringSelectionReference.Name
                        for filterHandle in t.FilterHandles:
                                filterReference = filterHandle.FilterReference
                                if filterHandle.Visible==True:
                                                print filterReference.Name
                                                print filterHandle.FilterReference.ToString()

1 comment:

  1. Hi, can I ask, if you dont use filter groups how can we get this to work. Many thanks for the article.

    ReplyDelete