Spotfire Ironpython-根据选择在下拉列表中选择另一个文档属性的文档属性
我正在尝试制作复杂的数据条件,仅在为逻辑设置属性值时,才应应用过滤器。
在下面的屏幕截图中,我试图设置一个条件,如果下拉级的业务为(无),则使用Ironpython脚本将业务过滤器设置为TRUE。
以下铁python脚本:
from System.Collections.Generic import List
from Spotfire.Dxp.Data import *
If Document.Properties["Business"] == NULL:
Return Document.Properties["BusinessFilter"] = TRUE
ELSE
Return Document.Properties["BusinessFilter"] = FALSE
但是代码不起作用。非常感谢您的帮助。
I am trying to make a complex data condition where the filter should be applied only if a property value is set for the logic.
In the below screenshot, I am trying to set a condition where if the Business in dropdown is (None), then the Business Filter will be set to TRUE using Ironpython script.
The iron python script is below:
from System.Collections.Generic import List
from Spotfire.Dxp.Data import *
If Document.Properties["Business"] == NULL:
Return Document.Properties["BusinessFilter"] = TRUE
ELSE
Return Document.Properties["BusinessFilter"] = FALSE
But the code isnt working. Your help is very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
则在属性“业务”更改值时设置要执行的脚本)
有一些语法问题,这对我有用(如果/其他似乎必须是小写的, ;您需要:在其他情况下,您不需要返回;如果您想要布尔属性,则需要采用Python格式(因此不是True)。该代码在没有进口的情况下起作用。
There are a few syntax issues, this worked for me (setting the script to be executed when the property 'Business' changes value)
if/else seem to have to be lowercase (you notice they are right when they turn blue in the editor); you need : after else, you don't need Return; and True and False need to be in Python format (so not TRUE but True) if you want a boolean property. The code worked without the imports on top.
我能够轻松地使用以下代码获得所需的过滤逻辑。
现在,当选择“业务”过滤器时,我可以使用“业务”过滤器过滤数据,否则请使用所有数据可见。
I was able to obtain the desired filtering logic using the below code easily.
Now I am able to filter data using "Business" filter when selected otherwise go for all data to be visible.