[英]Iron python script to remove some columns from a crosstable visualization in spotfire
I have few views listed and every time a user select a view few columns need to be excluded from the cross table visualization in the spot fire.我列出的视图很少,每次用户 select 时,都需要从现场火灾的交叉表可视化中排除几个视图。 I am new to spot fire so was searching for any method or Iron python script to perform the same
我是新手,所以正在寻找任何方法或 Iron python 脚本来执行相同的操作
An example of your report would help to provide a better answer.您的报告示例将有助于提供更好的答案。
If you can pass the view selected as a document property, then have a python script fire off when that document property changes, pull in the cross table as a parameter as well as that document property, and change the axis expressions as desired.如果您可以将选择的视图作为文档属性传递,则在该文档属性更改时触发 python 脚本,将交叉表作为参数以及该文档属性拉入,并根据需要更改轴表达式。 A sample script is below:
示例脚本如下:
from Spotfire.Dxp.Application.Visuals import *
from Spotfire.Dxp.Data import *
myVis = myVis.As[Visualization]()
if viewSelected == "View A":
# Horizontal:
myVis.ColumnAxis.Expression = "<[Column 1]>"
# Vertical:
myVis.RowAxis.Expression = "<[Column 2] NEST [Column 3]>"
# Cell values:
myVis.MeasureAxis.Expression = "Sum([Actual]), Sum([Forecast])"
elif viewSelected == "View B":
# Horizontal:
myVis.ColumnAxis.Expression = "<[Column 4]>"
# Vertical:
myVis.RowAxis.Expression = "<[Column 5] NEST [Column 6]>"
# Cell values:
myVis.MeasureAxis.Expression = "Sum([Plan]), Sum([Difference])"
else:
# Horizontal:
myVis.ColumnAxis.Expression = "<[Column 7]>"
# Vertical:
myVis.RowAxis.Expression = "<[Column 8] NEST [Column 9]>"
# Cell values:
myVis.MeasureAxis.Expression = "Sum([Forecast]), Sum([Plan])"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.