Jump to content
We've recently updated our Privacy Statement, available here. ×

Spotfire change table source, columns on button click


Geo G

Recommended Posts

Hello George,

You can use the below script to change the data source of a TablePlot and also select the columns

 

from Spotfire.Dxp.Data import *

from Spotfire.Dxp.Application.Visuals import *

from System.Collections.Generic import List

 

#Different Data Tables

table1=Document.Data.Tables["table1"]

table2=Document.Data.Tables["table2"]

 

#list of Column to add

listofColumns=List[DataColumn]()

for column in table1.Columns:

#excluding column "columnName" from the list

if column.Name!="columnName":

listofColumns.Add(column)

#Add a script parameter "table" referring to the TablePlot visualization in the analysis

tableVis=table.As[TablePlot]()

tableVis.Data.DataTableReference=table1

tableVis.TableColumns.AddRange(listofColumns)

Link to comment
Share on other sites

  • 2 years later...

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...