Functions Data

Relationship

Relationships exist between entities. For example, a portfolio has constituents (a set of instruments). The portfolio is said to be related to these instruments through the relationship type. The Relationship() function returns the entities linked to a primary entity according to a specified relationship type.

Related functions: RelationshipData()Relationship.Period()Hierarchy()ReverseHierarchy()
ReverseRelationship().


Syntax:

Qx.Relationship(Entity, Relationships, IAAD, View, Source, Interp method, ShowError)
  • In Excel with Quintessence addin versions prior to 25.1, use: Relationship()
  • In the Quintessence Editor (Studio) using Quintessence language, use: Relationship()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.Relationship()
 See parameter descriptions

EntityAn entity in the Quintessence database is any element with associated data
that is identified by a code, such as an instrument, portfolio, country, or manager.
RelationshipsThe relationship between the child and parent entities.
IAAD
(optional)
The as at date specifies the point in time for the information.
Relationships established after this date will not be shown.
View
(optional)
Defines how the data should be displayed. Options include:
• none return default columns without headers
• column return default columns with headers
• Dataview():header returns columns with or without headers.
See more on DataView.
Source
(optional)
The source provider of the data.
 
Interp method
(optional)
Includes both interpolation and extrapolation. Interpolation estimates
a value that lies between two known values in a sequence, while extrapolation
estimates a value by extending a known sequence of values or facts beyond
its established range.

The only valid options for Relationship() are:
• None:Forward performs forward interpolation using the last set of
constituents prior to the specified IAAD.
• None:None returns the constituents on the specified IAAD without
interpolation.
ShowError
(optional)
If TRUE, an error message is displayed when the function fails.

Remarks:

  • Unless changed by an administrator, the default parameters are:
    • IAAD: today
    • View: none. The column returned will be the list of constituents.
    • Source: determined by implicit or explicit defaults, if available.
    • Interp method: None:Forward
  • It is always safer to specify the source parameter rather than relying on the default. Leaving this blank not only depends on explicit defaults set by the administrator, but also on data being loaded, which may cause conflicts with implicit defaults.
  • In Quintessence versions 23.1 and later, if the interpolation and extrapolation options are the same (for example, Linear:Linear), you can simply pass Linear.

Examples:

The examples provided below are based on fictitious data for illustrative purposes only.

> Example 1: Return the constituents linked to a portfolio


Retrieve the constituents linked to fund 5030 as of 1 January 2015, including all columns and headers.

=Qx.Relationship("5030","Constituent","1 Jan 2015","Dataview(*):column","StockExchange1")
ParentRelationshipSourceDateChild
5030ConstituentStockExchange12015/01/01CEB
5030ConstituentStockExchange12015/01/01MBD
5030ConstituentStockExchange12015/01/01KVJ
5030ConstituentStockExchange12015/01/01GMP
5030ConstituentStockExchange12015/01/01YKG
5030ConstituentStockExchange12015/01/01PHO