This article provides an example on how to add a calculated column in Spotfire and also add it automatically to a table visualization.
Introduction
This article provides an example on how to add a calculated column in Spotfire and also add it automatically to a table visualization.
Code Sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Data import CalculatedColumn from Spotfire.Dxp.Application.Visuals import TablePlot mycol='NewSales' cols = Document.Data.Tables["Data Table"].Columns newcol=cols.AddCalculatedColumn(mycol,"[Sales] * 2.9"); tp = vis.As[TablePlot]() if newcol.Name == mycol: tp.TableColumns.Add(newcol) #vis a script parameter referencing the TablePlot visualization
References
- API Reference:CalculatedColumn
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.