TIBCO Cloud™ Spotfire® Web Client User Guide

Configuring an on-demand data table

When working in the installed client, data from a data connection or from an information link can be added as an on-demand data table. By editing the on-demand settings in the data canvas, you can also configure a data table from an external data connection to use on-demand.

About this task

Before you begin

Some of the functionality described here can only be authored or accessed using the installed Spotfire client.

Procedure

  1. On the authoring bar, click Files and data .
  2. In the flyout, locate the data connection or information link of interest by searching for a suitable keyword or by browsing the different categories.
  3. In the summary view showing the data tables to add or update, click on the data of interest and select On-demand from the drop-down list showing load methods.
  4. Click Configure.
  5. Define what type of input will control the on-demand loading. In the Define input for parameters that should control loading list, click each of the columns or parameters from the on-demand data table that you want to use (it might be just a single column), and specify a condition that must be fulfilled for any data to be loaded.
    For each parameter that should control loading, click Define Input and specify how the input should be defined. For example, if you want the input to be marked values from a column in another data table in the analysis, you would pick Values from column, and choose the data table and column to get the marked rows from. See more details in the examples below and on Conditions to control on-demand data.

    Any required prompts or parameters that were specified upon the creation of the on-demand data table will be listed as Required parameters in this field. This means that you must specify input handling of these parameters to load any on-demand data at all.

  6. Determine whether the data table should Load automatically on change of inputs, or to use a manual recalculation.
    If the check box is cleared, you must manually click the refresh icon on the visualization title bar to get an updated visualization.
  7. Determine whether to Allow caching.

    Allowing caching might speed up the process when loading new subsets of data. However, if the underlying data is updated during the current Spotfire session you can end up with different results for a specific set of input values depending on whether the current selection is stored in the cache. Always clear the check box if you know that the underlying data can be updated during your current session.

    Note: This caching is done on the client and it is based entirely on the input values, without any connection to the underlying data. No query is sent to the data source to see if that data has changed.

    So, if you have defined an input based on the values in a column, data will not be reloaded unless the input has changed since the last time. If you are disabling and enabling this setting again, the existing client cache will be used once again.

  8. When you are done specifying your parameters, click OK.
  9. In the summary view, click OK.
    Tip: You can edit the on-demand settings from the Data canvas. By editing the on-demand settings you can enable on-demand loading for a data source that previously did not use on demand, also for an external data connection.
    Tip: You might also want to add a relation between the two data tables, so the marked rows from the master data table also become marked in the on-demand data table visualizations. This can be done from the Data Table Properties dialog. See Data Table Properties - Relations in the Spotfire Analyst User Guide for more information.

An on-demand details visualization controlled by marking

This is an example where you select to load data on demand, and you specify a marking that should control what data to be loaded.

About this task

When you mark items in a visualization that uses the specified marking, the data for the on-demand data table is updated. The update can either be done automatically each time you change the marking, or manually by clicking on the refresh button shown when the marking is changed.

This way, you can create a main visualization in which to specify the item of interest, and an on-demand visualization where more information about the marked item is loaded from the database only when requested. This is similar to the use of a details visualization based on external data.

When one identifier column in the first data table is matched by a similar identifier column in the on-demand data table, the on-demand data table can be added and configured using the following steps:

Procedure

  1. On the authoring bar, click Files and data .
  2. In the Files and data flyout, locate the data source (a data connection or an information link ) of interest.
  3. When you have selected your data, the Add data to analysis summary view is shown. Make sure that the new data is added as a new data table, if this is what you want.
  4. From the drop-down list, showing Import or External, select On-demand.
  5. Click Configure.
  6. In the On-Demand Settings dialog, under Define input for parameters that should control loading, click to select the column in the new data that contains the identifiers.
  7. Click Define Input.
  8. In the Define Input dialog, under Input for the selected parameter, select Values from column.
  9. Select the Data table used by the main visualization that you want to use to control the details visualization and the on-demand data.
  10. Select the Column containing identifiers in the main data table.
  11. Make sure that the Marked rows check box is selected, and that only the check box for the marking used in the main visualization is selected.
  12. Click OK to close the Define Input dialog.
  13. In the examples below, the Load automatically check box to has been cleared to use manual update only.
  14. Click OK to close the On-Demand Settings dialog.
  15. Click OK to add the on-demand data.
    The on-demand data table is loaded. The data shown in any visualization based on the on-demand data table will depend on what is marked in the main visualization.

Results

Assume that a manual update was selected (the Load automatically check box was cleared), and you have created a main visualization that looks as follows:


Another visualization is added, based on the on-demand data table. When clicking an item in the main visualization, the refresh button is shown on the title bar of the visualization based on the on-demand data. (If nothing was marked from the beginning, the on-demand visualization will be empty until the first refresh.) Click Refresh data table.



The visualization is updated to show details about the marked item:



Clicking a different item in the main visualization once again shows the refresh button in the on-demand visualization.



Click refresh to update the on-demand visualization to use the new marking:



An on-demand data table controlled by a property

The data that is to be loaded on demand can be controlled in a number of ways. The example below uses a property control in a text area to select which data to show in a bar chart based on an on-demand data table.

About this task

In this example, we first assume that we have a data table containing a string column called "Type" which lists a number of different product types loaded in the analysis. We also assume that there is a data connection with some additional data available, which also contains a "Type" column. See Adding Data Connections to an Analysis or How to Work with Data Connections and their Data Sources in the Library in the Spotfire Analyst User Guide for more information about connections.

Procedure

  1. Follow steps 1-5 in the example above to open the On-Demand Settings dialog.
  2. In the Define input for parameters that should control loading list, click to select the column containing the product types ("Type").
  3. Click Define Input.
  4. In the Input for the selected parameter list, select Values (fixed/properties/expression).
  5. Click the Property radio button.
  6. Click Select.
  7. In the Select Property dialog, if no suitable property is available, click New (in the Document Properties tab).
  8. In the New Property dialog, define a string property using one of the available product types as default value. For example, create a string property called "Type" with the value "Apples".
  9. Click OK in all dialogs and the flyout.
    The on-demand data table is loaded using the limiting default value and can be used in visualizations. In the example below, the visualization used is a bar chart showing the sum of sales for Apples in four different regions.


    By adding a property control to a text area, other people can easily change the value of the document property and, hence, update the on-demand visualization. See Adding a property control to a text area for more information.



    If Load automatically was selected in the on-demand settings, the visualization will be updated each time the property is changed via the control. If Load automatically was cleared, a refresh button will be displayed on the title bar of the visualization each time the input is changed.