Remove/ delete or hide column in spotfire

给你一囗甜甜゛ 提交于 2019-12-11 05:07:52

问题


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)

`


回答1:


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"])



回答2:


Remove a column by

cols.Remove("NameOfColumnToRemove")



来源:https://stackoverflow.com/questions/21108946/remove-delete-or-hide-column-in-spotfire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!