Cascading Property Control Drop downs with On-Demand Data Tables


One of the nice features of TIBCO Spotfire 3.1 is the enhanced ability to load data on-demand.   In previous versions, when loading data from an Information Link, you could prompt a user to select specific values to load. The downside of this is when you wanted to change those selected values, you needed to reload the Information Link. This would cause your document to close and re-open, losing any updates you made to the state of your document.

Starting in version 3.1, you can create an On-Demand Data Table , which can be used to let the user select what to load. The user can change their minds and load something else later on, keeping the document open and the state of the document unaffected. This makes it much easier for users to drill down and look at various characteristics of the data, without having to load the entire data table into memory initially.  In this case, you load the data only when you need it.

To do this, first you will need to create an Information Link which only contains the Column which you want to filter on first. For example, if we have a Data Table which contains 'Region', 'State', and 'City', along with other Columns, and we want to allow the user to select which region to load, you would create an Information Link which only contains the 'Region' column.

To do this, inside the Information Designer, create an Information Link which just contains the 'Region' column, and then specify to use 'Distinct' conditioning.


While you are in the Information Designer, you should create another Information Link which will include all the columns you want to load for your analysis. No conditioning should be applied.

Now that you created the Information Links, from within Spotfire Professional, choose File  > 'Open From > Library'' and select the first Information Link you created (which just includes the 'Region' column). This should load a data table with just one column and just the unique values in that column:

 

Now we will create a Text Area and add a Drop-down list Property Control into it.

 

 

In the resulting 'Property Control' dialog, create a new Document Property then for the 'set Property value through' option, select ' Unique values in column'. Choose the 'Region' column and make sure you check to Include None as an option.
 

We now have a working dropdown which will allow the user to select one of the regions.

Next, we need to load the full data table. For this, choose File > Add On-Demand Data Table and select the second Information Link you created which includes all the columns you want in your analysis. Make sure you check the 'Load automatically' checkbox.


 
From within the same 'Add On-Demand Data Table' dialog, highlight the 'Region' column and click the 'Define Input'' button.

On the resulting 'Define Input' dialog, select 'Values (fixed/properties/expression)' as the Input type and in the Settings section, select 'Property' and select the Document Property you created earlier.
 

Now, create more of your analysis that you would like to see. For example, for my data table, I created a Bar Chart which show the sum of my sales change from Q3 to Q4 (which is a column in my data set) on y-axis and City on the x-axis. Since we have not loaded the full data table yet, the chart will be empty:

Once you select a region, an Information Link will go and retrieve the data specific for that region and then populate the current document and its visualizations. You can later switch the value in the drop down and the same Information Link will be executed, but this time, it will return only values for the newly selected property value.

Using the same concepts, you can add a second Drop-down list Property Control (or even a third and a fourth), which will act as sequential drop-downs. For example, in the image below, we have added another Drop-down list Property Control to control which 'State' to select. 'State' is another column in our data table.  The State Property Control will update to show only the values appropriate for the selected Region.

The new On-Demand data loading in 3.1 adds a variety of nice features shown above. First, it can be used to allow the user to specify what data to load into the analysis, and the user can change the values later on, without reloading the document. Second, you can create core visualizations that are not details visualizations (which was the case in the data on demand feature before Spotfire 3.1).

Don't use Information Links currently? In next week's post we will recreate the cascading drop downs without using Information Links. All the data will be loaded into Spotfire, but you can use the drop downs to select what information to show in given visualizations.