RelationshipPeriod
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 “Constituent”.
The RelationshipPeriod() function returns the relationships that were active between a parent entity (e.g., a fund) and its child entities (e.g., its constituents) for the dates falling within the specified range.
Related functions: RelationshipData, Relationship
Syntax:
Qx.RelationshipPeriod(Entity, Relationships, [Start Date], [End Date], [Frequency], [Interp Method], [View], [Source(s)], [ShowError])- In Excel with Quintessence add-in versions prior to 25.1, use:
Relationship.Period() - In the Quintessence Editor (Studio) using Quintessence language, use:
RelationshipPeriod() - In the Quintessence Editor (Studio) using Python language, use:
Qx.RelationshipPeriod()
ⓘ 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. |
| Start Date (optional) | The date delimiting the start of the range of value dates under consideration. |
| End Date (optional) | The date delimiting the end of the range of value dates under consideration. |
| Frequency (optional) | Depending on the frequency selected, a date in the range may or may not be included in the result. Possible values: • P – Points• D – Days• WS – Week starts• WE – Week ends• MS – Month starts• ME – Month ends• QS – Quarter starts• QE – Quarter ends• YS – Year starts• YE – Year endsAny value prefixed with T means trading days only.For example, TWE means week ends that are also trading days. |
| 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 valid options are None, Forward. |
| View (optional) | Defines how the data should be displayed. Valid option: • DataView():header returns columns with or without headers.See more on DataView. |
| Source(s) (optional) | The source(s) provider of the data. |
| ShowError (optional) | If TRUE, an error message is displayed when the function fails. |
Remarks:
- Unless changed by an administrator, the default parameters are:
- Start Date, End Date: today
- Frequency:
P - Interp method:
None:None - View:
DataView(parent, relationship, source, date, child) - Source(s): determined by implicit or explicit defaults, if available.
- 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.
- The Relationships parameter accepts only one relationship type per function call. If multiple relationship types are required, they must be retrieved using separate function calls.
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Return the constituents linked to a portfolio on a specific date
Data in the Quintessence database:
- Relationship type: Constituent
- Provider: MarketDataProvider2
| Parent | Child | Date |
| 5000 | CEB | 1 Jan 2007 |
| 5000 | MBD | 1 Feb 2007 |
| 5000 | CEB | 1 Feb 2007 |
| 5000 | MBD | 1 Mar 2007 |
| 5000 | KVJ | 1 Mar 2007 |
| 5000 | GMP | 1 Mar 2007 |
| 5000 | CEB | 1 Mar 2007 |
Retrieve constituents linked to fund 5000 on 1 Feb 2007. Formula:
=Qx.RelationshipPeriod("5000", "Constituent", "1 Feb 2007", "1 Feb 2007", , , , "MarketDataProvider2")Result:
| 5000 | Constituent | MarketDataProvider2 | 1 Feb 2007 | MBD |
| 5000 | Constituent | MarketDataProvider2 | 1 Feb 2007 | CEB |
