Ashish Kumar
Ashish Kumar

Reputation: 171

Remove/ delete or hide column in spotfire

How to remove/delete or hide column using iron script in spotfire ?

For adding a column i have done as follows:

`

curDT = Document.ActiveDataTableReference
cols = curDT.Columns
# targetCol = Document.Properties["myColumnSelection"]

#Create a new column that counts the comma delimiter
myExpression = '1+len(RXReplace([Cx],"([A-Za-z0-9]+)","","g"))'
myNewColName = cols.CreateUniqueName("NumElements")
cols.AddCalculatedColumn(myNewColName, myExpression)

`

Upvotes: 1

Views: 9960

Answers (2)

Mickaël M.
Mickaël M.

Reputation: 86

if it can still be helpful:

from Spotfire.Dxp.Application.Visuals import VisualContent
contentTable = myTableVisualization.As[VisualContent]()
if contentTable.TableColumns.Contains(myData.Columns["MyColumn"]):
        contentTable.TableColumns.Remove(myData.Columns["MyColumn"])

Upvotes: 4

Johan Kullingsjo
Johan Kullingsjo

Reputation: 21

Remove a column by

cols.Remove("NameOfColumnToRemove")

Upvotes: 2

Related Questions