Replacing a data source
A data table can be based on data from one or more data sources. You can replace an individual data source in the source view of the expanded data panel. This is often preferred over replacing the entire data table.
It is possible to reuse the visualizations, calculations and setup from a previously created analysis with new data, as long as the new data is reasonably similar to the old data.
By replacing a data source, rather than replacing the entire data table, you can keep the data table intact. That means that all transformations, calculations, added rows or columns, and operations that were used to build the final data table are kept as is. Use these steps to switch from a test database to a production database, or when your data remains exactly the same but is moved from one type of data source to another.
When you replace a data source (e.g., from a local file data source to a source file in the library), the data loading behavior will be switched to the default setting for the selected type of source. In most cases, the data loading behavior can be changed by clicking on the bottom part of the source node in the source view, should the new default not be what you wanted.
- In the Data panel, click the Expand data panel for tools and details button, .
If you cannot see the source view button, you may need to click the Go to data table view link first.
In the source view of the expanded data panel, locate the node that represents the data source you want to replace and click on it.
Details about the selected node are shown in the bottom left part of the source view.
- Locate the 'Loaded data' step and click on the arrow button, .
- Choose the new data and close all dialogs.
When a data source is replaced, Spotfire attempts to keep any existing transformations on the data source, if this is possible.If you select a new data source that does not support transformations directly on the data source, the transformations will still be kept, but they will be moved to a separate group in the data source history.
Example: Switching from a local data source to a Salesforce.com connection
In this example, someone has configured an analysis with good visualizations using local data from Excel, and you want to replace the data with fresh data using your Salesforce account.
Open the Source view and click on the interesting node.
In the lower part of the data source, click on the arrow button next to the Loaded data step.
Select the new data by choosing the type of source (Salesforce.com), logging in, and browsing to the interesting data. See Creating a new analysis from Salesforce.com data for details.
Click OK to load the new data.
In this example, the old transformation used on the previous data source was moved to a separate step, because data connections cannot have transformations directly on the source.
Also note that the data loading behavior has changed from the previously specified 'New data when possible' to 'Always new data', which is the default data loading behavior for a data connection:
As it turns out, the transformation is no longer needed, as indicated by the tooltip on the information icon, and it can easily be removed:
The data has now been replaced and the analysis is ready to be used.