Product: TIBCO Spotfire®
How can I make my property controls carry across multiple data tables instead of just altering the original data table values they were made in conjunction with?
You may be encountering this issue, for example, if you have created a data table from another data table in your analysis and have property controls that pertain to a column that is shared by both data tables. Furthermore, the property control in this instance would be made in correspondence with the original data table. Although the column that is affected by the property control was carried over into the new data table, only values in the original data table are altered based on property control input. The ultimate aim in this case is for the property control to update the shared column in both the original and recently created data table.
To allow property controls to affect multiple data tables, make sure that the newly created data tables are linked to the original data table source instead of embedded in the analysis. To change a data table from embedded to linked to source, go to Edit> Data Table Properties, select the ‘General’ tab, choose ‘Linked to Source’ instead of ‘Embedded in Analysis’ for the ‘Store data’ option, click ‘Apply’, then click ’OK’. The property controls will now apply to both data tables since the new data table is linked to the original data table.
You will see, however, that although the data tables are now linked, only values in the original data table will be updated automatically after altering the property controls and the new data table columns will remain unchanged. The observed behavior is a result of the newly created data table being a derivative table, meaning its values are solely based off of values from another table inside the analysis. In Spotfire, derivative table data is not altered simultaneously with data changes in the linked source table. One workaround to this issue is script a data table refresh, which passes updated information from the original data table into the linked data table. To achieve this, go to Insert> New Text Area and toggle into editing mode. Select the ‘Insert Action Control’ icon, choose ‘Script’, and click ‘New’. Give the script a name, and insert an example of an IronPython script control such as:
####################################
from Spotfire.Dxp.Data import DataManager
table1 = Document.Data.Tables["NAME_OF_FIRST_DATA_TABLE"]
table2 = Document.Data.Tables["NAME_OF_SECOND_DATA_TABLE"]
etc…
DM = Application.GetService(DataManager);
DM.Tables.Refresh([table1, table2, etc...]);
#####################################
Next, click ‘Run Script’ to validate that the script is working and click ‘OK’. Finally, type in display text for the action control label, choose a control type, click ‘OK’, and toggle back out of editing mode. Now, after any property control is updated, be sure to select the action control just created to visualize the column changes across multiple tables of your analysis.
Comments
0 comments
Article is closed for comments.