Functions Data

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:  RelationshipRelationshipPeriod


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

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.
Relationship TypeThe relationship between the child and parent entities.
ChildrenThe constituents to add, remove, or set for the relationship.
Relationship dateThe date on which the relationship applies.
SourceThe source provider of the data.
StrategyDefines 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:

ParentRelationshipSourceDateChild
5010ConstituentPortfolioAdministrator12015/02/02XDU
5010ConstituentPortfolioAdministrator12015/02/02KVJ

Add VRR on 2 Feb 2015:

Formula:

=Qx.UpdateRelationship("5010", "constituent", "VRR", "2 Feb 2015", "PortfolioAdministrator1", "Add", TRUE)

Result:

ParentRelationshipSourceDateChild
5010ConstituentPortfolioAdministrator12015/02/02VRR
5010ConstituentPortfolioAdministrator12015/02/02XDU
5010ConstituentPortfolioAdministrator12015/02/02KVJ

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):

ParentRelationshipSourceDateChild
5010ConstituentPortfolioAdministrator12015/02/02VRR
5010ConstituentPortfolioAdministrator12015/02/02XDU
5010ConstituentPortfolioAdministrator12015/02/02KVJ

Remove KVJ for 2 Feb 2015:

Formula:

=Qx.UpdateRelationship("5010", "constituent", "KVJ", "2 Feb 2015", "PortfolioAdministrator1", "Remove", TRUE)

Result:

ParentRelationshipSourceDateChild
5010ConstituentPortfolioAdministrator12015/02/02VRR
5010ConstituentPortfolioAdministrator12015/02/02XDU

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:

ParentRelationshipSourceDateChild
5010ConstituentPortfolioAdministrator12015/02/02VRR
5010ConstituentPortfolioAdministrator12015/02/02XDU
5010ConstituentPortfolioAdministrator12015/02/03VRR
5010ConstituentPortfolioAdministrator12015/02/03XDU
5010ConstituentPortfolioAdministrator12015/02/03KVJ

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:

ParentRelationshipSourceDateChild
5010ConstituentPortfolioAdministrator12015/02/02VRR
5010ConstituentPortfolioAdministrator12015/02/02XDU
5010ConstituentPortfolioAdministrator12015/02/03VRR
5010ConstituentPortfolioAdministrator12015/02/03XDU
5010ConstituentPortfolioAdministrator12015/02/03KVJ
5010ConstituentPortfolioAdministrator12015/02/04VRR
5010ConstituentPortfolioAdministrator12015/02/04XDU
5010ConstituentPortfolioAdministrator12015/02/04KVJ