Jump to content

Customising Filters for Columns to be displayed


Prashanth Kumar 4

Recommended Posts

Creating dynamic cross tables is a great way to save space and empower users with options. Using document properties you can achieve giving user inputs for all axis of a viusal:

 

You can set up document properties to pass expressions to the axis' of viusals:

 

You can map multi values from a multi-select list to an axis of a visual using (cell values/expressions):

$map("${Expression2}", ",")or

for use with column or row axis

I've included a dxp with the example and other document property examples from a training dxp I created.

Check the Expressionspage

Link to comment
Share on other sites

For a Table plot you can use a script attached to a multi list select document property :

 

from Spotfire.Dxp.Application.Visuals import *

 

#Get Values from Multi-List Select

z = Document.Properties['teststuff']

 

#Get Visualization Vis1 is a script parameter

tbl1 = Vis1.As[VisualContent]()

 

#Get Data Table Reference for visual

dataTable= tbl1.Data.DataTableReference

 

# Get the ColumnCollection for the Table plot

columns = tbl1.TableColumns

#Clear Current Columns

columns.Clear()

 

#Add Columns

for x in z:

x = str(x)

columns.Add(dataTable.Columns.Item[x])

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...