How to permanently delete rows from data tables created by data functions in Spotfire

How to permanently delete rows from data tables created by data functions in Spotfire

book

Article ID: KB0070641

calendar_today

Updated On:

Products Versions
Spotfire Analyst All Versions

Description

The delete rows function in Spotfire Analyst, available via right clicking in a visualization > Marked Rows > Delete (see  Marking in Visualizations reference) is only persisted for the current session when the data table is linked to source, as it is does not keep record of which rows were deleted (like is shown for deleted columns). See Remove or delete rows in Spotfire community article for more details.

Suppose an example where a data table is populated by a data function and you are appending rows to the existing data table, with a data function like:
 optable = rbind(inptable,append)
where:
  • optable = final output data table
  • inptable = the same optable
  • append = the data frame object containing the rows that needs to be appended
So the rbind function will insert rows from the "append" data frame to the "inptable" and output the result to "optable".

This forms a cycle as rows are getting appended to the same table and so the "Refresh table automatically" option will be unchecked in Edit Parameters. Trying to check that option, will throw the cyclic dependency error, like:
User-added image

For example, if you have 20 rows in inptable and you append 30 rows, then optable would now have 50 rows. 

If you delete 10 rows from optable (by marking 10 rows in the data table > Right click visualization > Visualization Properties > Marked Rows > Delete) so that optable has 40 rows, then save the .dxp, and reopen it you observe that optable again has 50 rows instead of 40 rows.

Issue/Introduction

This article shows how to permanently delete rows from a data table created by data functions in Spotfire.

Resolution

This is because the current data in the data table (calculated through data function) is stored in the analysis and the data table is set to linked to source and not embedded (see Embedded or Linked Data? reference - this configuration can be checked from the Data Table properties). When the data table is embedded, it will not get refreshed from the source so the deleted rows will not return (unless the user explicitly tells it to refresh), but when the data table is linked to source it gets refreshed from the data already stored in the analysis so the deleted rows will be added again. The delete rows operation will have no impact after the initial session if the data table is linked to source as it will always get refreshed from the source upon next access.

You can use any of the following workarounds in order to delete the rows permanently:

1. Due to the cyclic dependency, the data function will not refresh automatically so it will require a manual trigger to refresh the data table. In this case, you can keep the data table (calculated from the data function like seen above) always embedded. This way you can delete rows as required and then the analysis can be saved and accessed later.

or

2. If you do not intend to keep the data table embedded, then you will need to refresh data function once after you delete the rows from the data table because the data function will take the new data set, which excludes the deleted rows, and appends the new rows to that. Then save the analysis and re-open it and the deleted rows will not reappear.

Additional Information

Doc: Marking in Visualizations Wiki: Remove or delete rows in Spotfire Doc: Data Function Properties Doc: Embedded or Linked Data?

Attachments

How to permanently delete rows from data tables created by data functions in Spotfire get_app