Custom sources – Relationship
See also:
How to create a Custom TimeSeries source
How to create a Custom RelationshipData source
Introduction to TimeSeries, TimeSeries(), Entities, Relationship(), RelationshipData()
How to create a Custom Relationship source
This example creates a relationship source that only returns instruments linked to a portfolio that are not in the Money Market sector.
To create a new custom Relationship source, click on the Relationship button and click ‘Language’. If the custom Relationship source needs to connect to an external database to retrieve data, the selection is then ‘SQL’:
When the custom Relationship source window opens, add a name and description for the new custom source:
Create a new relationship type called ‘Non MM Constituents’ (see How to create a Relationship):
Select the equation tab. Using the equation editor, enter the equations that perform the required calculations and output the results:
Test the results by supplying values for the variable parameters. In this example, only ‘Entity’ is required. Click on ‘Testing’ followed by ‘Execute’:
The test results are listed below. The results list all instruments linked to the portfolio ‘ABC123’ that are not in the Money Market sector:
On the Output tab, map the results to their output columns:
The custom Relationship source can be utilised in the Quintessence Application and in Excel using the Quintessence Excel® Addin:
The Relationship() function returns the constituents (Non MM Constituents) that are related to a specified portfolio, using the custom relationship source (NonMoneyMarketConstituents), yielding the following result: