ReverseRelationship
The ReverseRelationship()
function returns the primary entities that are linked to a specified entity based on a given relationship type. For example, it can return the portfolios to which a specified constituent is linked.
Related functions: RelationshipData(), Relationship.Period(), Hierarchy(), ReverseHierarchy(),
Relationship().
Syntax:
Qx.ReverseRelationship(Entity, Relationships, IAAD, View, Source, Interp method, ShowError)
- In Excel with Quintessence addin versions prior to 25.1, use:
ReverseRelationship()
- In the Quintessence Editor (Studio) using Quintessence language, use:
ReverseRelationship()
- In the Quintessence Editor (Studio) using Python language, use:
Qx.ReverseRelationship()
ⓘ See parameter descriptions
Entity | An 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. |
Relationships | The 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 ReverseRelationship() 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 passLinear
.
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Returning the portfolios to which a constituent is linked
Retrieve the portfolios linked to constituent XDU as of 1 January 2015.
=Qx.ReverseRelationship("XDU","Constituent","1 Jan 2015","Dataview(*):column", "StockExchange1")
Parent | Relationship | Source | Date | Child |
XDU | Constituent | StockExchange1 | 2015/01/01 | 5010 |
XDU | Constituent | StockExchange1 | 2015/01/01 | 5040 |
XDU | Constituent | StockExchange1 | 2015/01/01 | 5070 |
Compared to the Relationship() function, the Parent column in ReverseRelationship()
displays the constituent entity specified in the data call, while the Child column displays the portfolio that contains the constituent.