Michael Springer 2 Posted June 11, 2019 Share Posted June 11, 2019 I have a data source that I got from OSI PI and add to an existing data table if it exists: ds = DataSourceImpl(pm) if Document.Data.Tables.Contains(dt_name): column_settings = AddRowsSettings(Document.Data.Tables[dt_name], ds) Document.Data.Tables[dt_name].AddRows(ds, column_settings) else: Document.Data.Tables.Add(dt_name, ds)However, I would like to calculate a new column based on values from the data source. I want the combined data source data and new calculated column added as rows to an existing datatable. How would I add this Link to comment Share on other sites More sharing options...
Sayali Patil Posted July 24, 2019 Share Posted July 24, 2019 Hello, Your question is not very clear but if you would like to add a calculated column to a data table this is how you can do it - from Spotfire.Dxp.Data import CalculatedColumn cols = Document.Data.Tables["MyTable"].Columns cols.AddCalculatedColumn("ThisIsACalculatedColumn", "Expression");If this is not what you are looking for please elaborate your question. Thanks! 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