
Spotfire has long had a powerful modeling environment for connecting to data. But did you know it’s also possible to just drop in your own custom queries? This can be a quick way to connect to data, especially if you already have a query ready to go.
The custom query option can be found after choosing to add a new Data Table (“File>Add Data Tables“). Select “Add > Connection To” and choose your data source type. After Spotfire introspects the source, you’ll be able to define your own custom query:
After defining the query, choose “Verify” and Spotfire will produce a summarized view of the result, along with the detected data types.
If your query requires input parameters, use placeholders in your query that have be prefaced with a question mark (“?“). This will allow you to define the parameter type on the “Parameters” tab of the custom query window. For on-demand tables, parameters can be defined using other areas of the analysis such as marking, filtering, or document properties. For primary tables, parameters can be passed in using configuration blocks. The syntax for setting custom query parameters is the same as the syntax for Parameterized Information Links. For more information, check out the reference links below.
To create a re-usable custom query, just define your query using “Tools>Manage Data Connections”. This will allow you to save your query in the Library for future use or for sharing with others.
Reference: