简体   繁体   中英

Spotfire: How to use calculated value (dynamic item) in ironpython script?

I'm using spotfire and ironpython.

I've created a calculated value (dynamic item) to know max date that match a condition in my data.

I also have a ironpython script to do some things and part of this script must use the date from the calculated value.

I'm trying to have python code to get the information from calculated value, but I'm struggling with it.

I couldn't do it "directly", so, now, I'm trying a work around... To create a document property to receive the calculated value and use this document property as enter parameter in the script, but I couldn't find a way to use calculated value as source of information of property document.

So... Is there a way to use calculated value inside ironpython script (directly or linking its value to a document property and using this document property as script parameter)?

You'll want to use a Data Function to pass the calculated value to a document property and then from there, IronPython can use it.

This can be a very simple data function where you'd bring in the table/column with the calculated value and output just the value. Something like this should work:

MyDocProp <- CalcValueTable$CalcColumn[1]

If you are a little more familiar with TERR, it's straight forward to get the calculated value entirely within TERR and remove the calculated column you are creating.

Be sure and set the Data Function to refresh automatically so that your document property is evergreen. You can then have your ironpython script run off a change in the MyDocProp document property so that anytime a max date changes, your script runs.

You are headed down the right path. You have to pass it to a document property. You can't use the calculated value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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