Tags are lost after data table refresh in TIBCO Spotfire

Tags are lost after data table refresh in TIBCO Spotfire

book

Article ID: KB0076336

calendar_today

Updated On:

Products Versions
Spotfire Analyst 7.5 and higher

Description

Tags are used to group data rows in a data table by attaching tags to rows. For example, if you want to gather the top 100 values into a common category, or to split results into categories like "Good", "OK", and "Bad" where you decide the boundaries: 
User-added image
With that in mind, if you apply tags to on-demand data table rows, you might observe that sometimes Tags are not retained after on-demand data table refresh, even though data table's key columns specified are unique and do not contain null values as mentioned in article about retaining Tags.

Such a situation can arise when the on-demand data table is refreshed with different sets of inputs than the previous refresh from when tags were created and attached to the marked rows.

For example:
Suppose, you mark position '2B' and 'C' in 'Imported' table and related rows get populated in 'On Demand' table. Then you mark some rows in 'On Demand' table and attach those to tag 'MarkedTags' as shown below:
User-added image


Now, you change the selection in 'Imported' table to '1B' and related rows get populated in 'On Demand' table. You will observe that the markings are no longer present in 'On Demand' table since the data has changed and rows/values tagged are also lost:
User-added image

Then you again mark position '2B' and 'C' in 'Imported' table assuming they would now get appear in tags as well because 'NAME' unique column has been specified in Key columns of table2. But tags are still 0 and previous tagged rows/values are lost:
User-added image

Issue/Introduction

This article provides overview on tags and why they may be missing after the refresh of a data table

Resolution

This behavior is as designed. Tags are specifically used for the same data set i.e. whose underlying data rows tagged are not expected to change. When a new data set is populated in a data table containing tags, tags would be lost. To workaround this scenario, you can use either of the following approaches:

Option 1: Use Lists
Use Lists instead of Tags whose values do not change whether data sets change or not. See documentation on Lists for more information.
User-added image

Option 2: Use IronPython Script
1. Mark rows in the 'On Demand' data table which you would like to tag. Click on an action control button which would store the Marked values from 'On Demand' data table to a document property using an Iron Python script. A sample Iron Python script to do that can be found here.

2. Then click on an action control button to trigger the 'On demand' data table refresh and tag the above marked values from the data set (if they are present present) using another Iron Python script. A sample Iron Python script to do that can be found here.
User-added image
Whenever you want to update the list of values stored in the document property, just perform step 1 again. 

Additional Information

Doc: What are tags? Doc: What are Lists? Wiki: How to tag marked rows in TIBCO Spotfire® using IronPython Scripting Wiki: Retrieve data marking selection KB: Tags and markings are not retained from one session to the next