This article provides a sample to set the limit data expression for a visualization with a Python script. The expression can be made dynamic by selecting a column value to limit the data, from a document property.
Introduction
This article provides a sample to set the limit data expression for a visualization with a Python script. The expression can be made dynamic by selecting a column value to limit the data, from a document property.
Code Sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Application.Visuals import * from Spotfire.Dxp.Data import * for vis1 in Application.Document.ActivePageReference.Visuals: if vis1.Title == vis.As[Visualization]().Title: visual = vis.As[Visualization]() visual.Data.WhereClauseExpression = "[Region]=" +"'" + Document.Properties["DPRegion"] +"'" #Here DPRegion is a drop down list document property listing down all the available values in the Region #column say 'East','West','North','South'
- API Reference:WhereClauseExpression
License: TIBCO BSD-Style License
Back to IronPyton Scripting in Spotfire Examples: https://community.spotfire.com/s/article/IronPython-Scripting-in-Spotfire
Recommended Comments
There are no comments to display.