Romain Falluret Posted February 6, 2023 Share Posted February 6, 2023 I have been searching for a way to create a new table from an existing one, but only with certain columns included. However, I have not found a solution yet. I have included my scripts in an attachment.I already checked this post and it help me to create the new table but with all columns. https://community.spotfire.com/wiki/how-add-new-data-table-based-existing-data-table-analysis-tibco-spotfirer-using-ironpython Link to comment Share on other sites More sharing options...
Fredrik Rosell Posted February 8, 2023 Share Posted February 8, 2023 Hello,You could use an ExcludeColumnsTransformation transformation for that (you don't specific what columns to include, but rather which ones to exclude).Here's a basic example of that:from Spotfire.Dxp.Data.Transformations import ExcludeColumnsTransformationfrom Spotfire.Dxp.Data import DataColumnSignature, DataTypefrom System.Collections.Generic import Listprint "The data table " + table.Name + " has " + table.Columns.Count.ToString() + " columns before."#Define columns to excludelist = List[DataColumnSignature]()list.Clear()col = table.Columns['Country Name']list.Add(DataColumnSignature(col))excludeColumns=ExcludeColumnsTransformation(list)# add transformationtable.AddTransformation(excludeColumns)print "The data table " + table.Name + " has " + table.Columns.Count.ToString() + " columns after." Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now