Code sample script to add relations between two data tables in an analysis.
Introduction
The following is a sample script to add relations between two data tables in an analysis.
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Data import DataRelation from Spotfire.Dxp.Data import DataRelationCollection from Spotfire.Dxp.Data import DataTableCollection # set the left and right tables tbl= Document.Data.Tables['tablename1'] tbr= Document.Data.Tables['tablename2'] # add the relation # "Region" is the column that relates the two tables Document.Data.Relations.Add(tbl, tbr,"[tablename1].[Region] = [tablename2].[Region]")
References
- API Reference: DataRelation Class
- API Reference: DataRelationCollection Class
- API Reference: DataTableCollection Class
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.