首页 > 解决方案 > 导出所有计算列的计算

问题描述

我继承了几个带有几个计算列的报告。为了理解和记录,我需要导出这些列后面的所有计算。

在网上搜索我找不到任何有用的东西。

到目前为止,该过程是打开每列的属性并手动复制公式。

有什么更有效的吗?

标签: spotfire

解决方案


您可以使用 IronPython 脚本来获取计算列的每个表名、列名和表达式。

myDict = {}
#Loop Through All Data Tables 
for x in Document.Data.Tables:
    #Loop Through all Columns in Table
    for z in x.Columns:
        #If Column has an Expression /Is Caculated Column 
        if z.Properties.Expression:
            #Append Items to Dictonary to print at end 
            MyItems = {'Table Name' : x.Name , 'Expression' :z.Properties.Expression  }
            myDict[z.Name] = MyItems
            #Print Each Table Name, Column Name and Expression
            print(x.Name , z.Name , z.Properties.Expression)
#Print Full List 
print myDict 

推荐阅读