Jump to content

Script to create drop-down list to switch between different data tables: tab defined error


Michele Comerford

Recommended Posts

An earlierquestion (How to create drop-down list to switch between different data tables) was answered with the Python script below that I'm trying to get to work. I get a NameError: name 'Tab' is not defined (my code is below). I tried to define Tab by addingmyTab = Tab.As[selfCreatedTable]()with the SelfCreatedTable being the visualization but it's still causing this error.How else do I need to define the tab

"You can use below script for changing the data table used for table visualization:

docproperty=Document.Properties["SelectedTable"]

Tab.As[TablePlot]().Data.DataTableReference= Document.Data.Tables[docproperty]

# Tab is the (Visualization) parameter passed to the script specify the table to work on

Then use below reference for adding desired columns from each data table in table visualization

https://community.spotfire.com/wiki/example-script-modify-which-columns-are...

http://spotfired.blogspot.com/2015/08/create-tableplot-and-add-columns.html

http://spotfired.blogspot.com/2014/04/add-columns-dynamically-to-data-ta..."

My script:

from Spotfire.Dxp.Application.Visuals import *

from Spotfire.Dxp.Data import *

myTab = Tab.As[selfCreatedTable]()

docproperty=Document.Properties["SelectedTable"]

myTab[TablePlot]().Data.DataTableReference= Document.Data.Tables[docproperty]

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