from Spotfire.Dxp.Data import CalculatedColumn
newColName = "test"
newColExpr = "TRIM([myTableCol])"
cc = Document.Data.Tables["myTable"].Columns.AddCalculatedColumn(newColName,newColExpr).As[CalculatedColumn]()
#change expression
cc.Expression = "Avg([myTableCol])"
#get calc column and change its expression
cc = Document.Data.Tables["myTable"].Columns["myCalcColumn"].As[CalculatedColumn]()
cc.Expression = "Avg([myTableCol])"
4 comments:
Hi Jose
How to convert the string column to other data types like "real" while creating calculated column using python?
Thanks
Do the cast in the expression itself. For example:
newColExpr = "real(Trim([myTableCol]))"
That worked like a charm. thanks
That's great! Is it also possible to Update de calculated columns using something similar?
Post a Comment