简体   繁体   English

使用列表中保存的列名作为过滤器 python

[英]Use saved column names in a list as a filter iron python

I am new to iron python.我是熨斗 python 的新手。 This is my first code.这是我的第一个代码。 I need to create a list filter that contains all the column names of a table.我需要创建一个包含表的所有列名的列表过滤器。 If I select a particular column name, the name of the column has to be stored in a document property.如果我 select 有一个特定的列名,则该列的名称必须存储在一个文档属性中。 Using that document property I will create some calculated columns.使用该文档属性,我将创建一些计算列。

Can anyone please guide me how to achieve this requirement?谁能指导我如何达到这个要求?

I am able to do some reading and save all the columns in a list but I don't know how to proceed further.我可以进行一些阅读并将所有列保存在列表中,但我不知道如何进一步进行。

from Spotfire.Dxp.Data import *

colNames = []
table = Document.Data.Tables['TableName']
for column in table.Columns:
    colNames.append(column.Name)
print(colNames)

It is possible in spotfire analyst itself.在spotfire分析师本身中是可能的。 Instead of using iron python I used "insert input field" and created a column property and added the columns for filtering.而不是使用铁 python 我使用“插入输入字段”并创建了一个列属性并添加了用于过滤的列。

any other suggestions are welcome for me to learn.欢迎任何其他建议让我学习。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM