Jump to content

wat to 'switch' data tables after script (via action button). so "run script" would show "data1" listing and a second script ("clear") would switch to "data2" which is: the same Columns as data1, but all missing. works but No columns show


Brad Evans

Recommended Posts

HI Frederik

thank you for the interest. We found a solution which is below. Our first effort removed the dataset completely when we set all values missing/null. Our second effort did NOT select all the columns, so, while the data table part worked no columns were listed.

Below is what we did, where MyVis is a script parameter pointing to the data listing visualization

=============================================================

from Spotfire.Dxp.Application.Visuals import *

from Spotfire.Dxp.Data import *

from Spotfire.Dxp.Application.Visuals import TablePlot, VisualContent

MyVis= MyVis.As[Visualization]()

#MyVis.AutoAddNewColumns = True

# 1. Change the data table

newTable = Document.Data.Tables.Item['Medium System Suitability Output']

MyVis.Data.DataTableReference = newTable

#2. Move all "Available columns:" to the "Selected columns:" listbox:

MyVis.TableColumns.Clear() #Clear first to prevent duplicate error

for i in newTable.Columns:

MyVis.TableColumns.Add(i)

 

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