Date Posted:
Product: TIBCO Spotfire®
Product: TIBCO Spotfire®
Problem:
Retrieve marked values from In-Database data table in TIBCO Spotfire Analyst
Solution:
Currently it is not possible to retrieve the marked values from an In-Database data table using IronPython and/or Javascript API or Data Functions (TERR).
You may get the following error when trying to read the marked values using Javascript API
ErrorInternal: Could not find method '_InternalFormat'.When trying to read marked data using Iron Python API, no data is retrieved in "markedselection = markings.GetSelection(dataTable)"
Data functions execution using R/TERR is only supported for imported data tables (In-Memory tables) not in-Database tables Marked values can be read only when data table is imported in TIBCO Spotfire Analyst.
a) You can use either of the options to import data table:
- Import the In-Db data table. See "Adding Data Tables" for more details
- Keep the current data table In-DB and add an imported On-Demand data table which is loaded based on the marking in the external data table. See "Data on demand" for more details
- Use spotfire.webPlayer.DataColumn.getDistinctValues in the JavaScript API like below
webPlayer.analysisDocument.data.getDataTable("onDemandTableName", function(dataTable) { dataTable.getDataColumn(String(columnName), function(dataColumn) { dataColumn.getDistinctValues(0, 10, function(distinctValues) { alert(distinctValues.count); }); }); });
- Use Iron python API to retrieve marked values from the imported data table. See "How to retrieve data marking selection using IronPython in TIBCO Spotfire" for more details
- Data function can be used to retrieve marked values in document property. See "How to execute an IronPython script on Filter or Marking change" for more details. Attached is MarkedValueDataFunction.dxp for reference. The TERR script will be:
output <- input
where:- input parameter is of column type pointing to column in data table whose marked values need to be retrieved
- output parameter is of value type pointing to document property in which values need to be stored
Comments
0 comments
Article is closed for comments.