Date Posted:
Product: TIBCO Spotfire®
Product: TIBCO Spotfire®
Problem:
How to use a drop down list to dynamically pass columns as the input of a data function
Solution:
If you have a data function which uses an input parameter with a Column as the input handler, then if you want to change the column being passed to the data function, you will need to edit the data function parameters each time the column needs to changes. Alternatively, you can use a property control to dynamically select a column and use that document property as the input parameter (for example a document property called "SelectColumn"). But in the Edit Parameters > Expression > Edit dialog, if you only select the document property, with an expression like:
[${SelectColumn}]Then upon selecting a new column in the property control, the data function may fail to execute with the error:
Could not calculate inputs. Argument 'myinputparam' could not be type checked.
If there are multiple data tables in the analysis file, the expression for the input parameter (as a document property) needs to have the data table included too. Otherwise, the data function will not be able to find the correct column from the correct data table every time you change column from the drop down list. To avoid the issue, edit the input parameter via:
- Edit > "Data Function Properties" > Select your data function and click "Edit Parameters" > "Input" tab > Select your input parameter
[BASEBALL].$esc(${SelectColumn})Now after the property control value changes with the selection of a new column, the data function will be able to automatically update using the newly selected column.
See the attached "QQ Plot Data Function Example.dxp" file as an example. Doc: Details on Edit Parameters:
Comments
0 comments
Article is closed for comments.