Search code examples
rdependenciescircular-dependencyspotfireterr

How to get rid of circular/cyclic dependencies in TIBCO Spotfire?


I have two tables that are linked via a relation (edit -> data table properties -> relations). One contains some raw data, and the other contains aggregated data (calculation on the value).


You can see some examples below. Here, data are linked on "category" column.

RAW DATA
category | id | value
---------+----+------
   A     |  1 |  10
   A     |  2 |  20
   A     |  3 |  30
   A     |  4 |  30
   B     |  1 |  20
   B     |  2 |  20

COMPUTED DATA
category | any_calculation  //aggregation of raw data based on category
---------+----------------
   A     |       10
   B     |       20

To do the calculation, I use a R/TERR function that take raw data as an input, and that output computed data.

Then I display raw data in a scatter plot (one per category), and I add a curve that is taken from the column "any_calculation" of the computed data.


My main problem is that my table with computed data isn't filled by the R/TERR script. The cause is, in my opinion, the cyclic dependency between those two tables.

Do you have any idea/workaround/fix ?

I should also add that I can't do the calculation in the scatter plot (huge calculation). I use Spotfire 7.8.0.


Solution

  • It seems like a table can't be modified/edited by different sources, that is to say multiple scripts (R and Python) can't have the same table as an output.

    To fix my problem, I created a new table in one of my script. Then I created a relation between this table and the other one from the other script.