UpdateRelationship
The UpdateRelationship() function updates a relationship in the Quintessence database – typically a relationship between a fund and its constituents.
This can include adding new constituents on a given date, updating an existing set of constituents, or removing constituents.
Related functions: Relationship, RelationshipPeriod
Syntax:
Qx.UpdateRelationship(Entity, Relationship Type, Children, Relationship date, Source, Strategy, [ShowError])- In Excel with Quintessence add-in versions prior to 25.1, use:
UpdateRelationship() - In the Quintessence Editor (Studio) using Quintessence language, use:
UpdateRelationship() - In the Quintessence Editor (Studio) using Python language, use:
Qx.UpdateRelationship()
ⓘ 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. |
| Relationship Type | The relationship between the child and parent entities. |
| Children | The constituents to add, remove, or set for the relationship. |
| Relationship date | The date on which the relationship applies. |
| Source | The source provider of the data. |
| Strategy | Defines how the update should be applied. Valid values: • Set – Replace the entire list.• Add – Add the specified children.• Remove – Remove the specified children.Set can also be combined with: • Always – Always make the change.• OnChange – Only make the change if the set has changed.Example: Set, Always |
| ShowError (optional) | If TRUE, an error message is displayed when the function fails. |
Remarks:
- This function is executed by clicking Execute Selected or Execute Sheet in the Quintessence ribbon.
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Updating relationships on multiple dates
Initial data:
| Parent | Relationship | Source | Date | Child |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | KVJ |
Add VRR on 2 Feb 2015:
Formula:
=Qx.UpdateRelationship("5010", "constituent", "VRR", "2 Feb 2015", "PortfolioAdministrator1", "Add", TRUE)Result:
| Parent | Relationship | Source | Date | Child |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | KVJ |
Set VRR, XDU, KVJ for 3 Feb 2015 only if different from previous day:
Formula:
=Qx.UpdateRelationship("5010", "constituent", "VRR, XDU, KVJ", "3 Feb 2015", "PortfolioAdministrator1", "Set, Onchange", TRUE)Result (No change yet):
| Parent | Relationship | Source | Date | Child |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | KVJ |
Remove KVJ for 2 Feb 2015:
Formula:
=Qx.UpdateRelationship("5010", "constituent", "KVJ", "2 Feb 2015", "PortfolioAdministrator1", "Remove", TRUE)Result:
| Parent | Relationship | Source | Date | Child |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | XDU |
Set VRR, XDU, KVJ for 3 Feb 2015 only if different from previous day: Now the list for 3 Feb is different from 2 Feb, so the Set, OnChange takes effect.
Result:
| Parent | Relationship | Source | Date | Child |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/03 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/03 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/03 | KVJ |
Add VRR, XDU, KVJ for 4 Feb 2015 (Set, Always):
Formula:
=Qx.UpdateRelationship("5010", "constituent", "VRR, XDU, KVJ", "4 Feb 2015", "PortfolioAdministrator1", "Set, Always", TRUE)Result:
| Parent | Relationship | Source | Date | Child |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/02 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/03 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/03 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/03 | KVJ |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/04 | VRR |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/04 | XDU |
| 5010 | Constituent | PortfolioAdministrator1 | 2015/02/04 | KVJ |
