Derivation formulas part 2: Entity components

A derived property has a derivation formula that instructs LUSID how to automatically calculate (ie. derive) property values.

Required reading: Derivation formulas part 1: Operations and allowed values

Depending on the operation, allowed values can be strings or numbers, but they can also be components of entities such as data fields, identifiers, custom properties, system properties, and even other derived properties. Note the exact components you can reference differ depending on the type of entity the derived property belongs to: 

You can reference certain components belonging to transactions, instruments and portfolios in a formula for a holding derived property, for example:

if(HoldingType eq 'P' 
and SubHoldingKeys[Transaction/SHKs/Strategy] eq 'Growth' 
and Properties[Portfolio/Ibor/Region] eq 'USA') 
then 'United States' else 'Rest of world'
JSON

Entity components

Belonging to holdings

Belonging to other types of entity

Transactions

Instruments

Portfolios

Stored data fields

Any for holdings. Nested fields can be referenced using dot notation. For example:
InstrumentUid
HoldingType
Cost.Currency

Only in certain circumstances (see note below table)

N/A

N/A

Identifiers

N/A

Transaction instrument identifiers, for example:
Transaction.InstrumentIdentifiers[Instrument/default/Figi]

N/A

N/A

Sub-holding keys (SHKs)

For example:
SubHoldingKeys[Transaction/X/Y]
SubHoldingKeys[Transaction/Y/X]

N/A

N/A

Properties

Custom properties, including other derived properties. For example:
Properties[Holding/X/Y]
Properties[Holding/Y/X]

System properties, for example:
Properties[Holding/default/SourcePortfolioId]
Properties[Holding/default/SourcePortfolioScope]

Only in certain circumstances (see note below table)

Instrument custom properties, including derived properties. For example:
Properties[Instrument/X/Y]
Properties[Instrument/Y/X]

Instrument system properties, for example:
Properties[Instrument/default/Name]

Properties[Instrument/default/Scope]

Portfolio custom properties, including derived properties. For example:
Properties[Portfolio/X/Y]
Properties[Portfolio/Y/X]

Portfolio system properties, for example:
Properties[Portfolio/default/ModelFees]

Properties[Portfolio/default/FundFamily]

Note: If you include transaction fields and/or properties in a formula for a holding derived property then the derivation only succeeds for holdings that have a one-to-one relationship with a transaction, namely temporary currency holdings generated by the CashCommitment, CashReceivable, CashAccrual, CashForward and CashFxForward movement types.

You can reference certain components belonging to instruments in a formula for a transaction derived property, for example:

if(TotalConsideration.Currency eq 'USD' 
and Properties[Instrument/Ibor/Region] eq 'USA') 
then 'United States' else 'Rest of world'
JSON

Entity components

Belonging to transactions

Belonging to other types of entity

Instruments

Portfolios

Stored data fields

Any for transactions. Nested fields can be referenced using dot notation. For example:
TransactionId
TransactionPrice.Price
TotalConsideration.Currency

N/A

N/A

Identifiers

For example:
InstrumentIdentifiers[Instrument/default/ClientInternal]
InstrumentIdentifiers[Instrument/default/Figi]
InstrumentIdentifiers[Instrument/default/LusidInstrumentId]

N/A

N/A

Properties

Custom properties, including other derived properties. For example:
Properties[Transaction/X/Y]

Properties[Transaction/Y/X]

System properties, for example:
Properties[Transaction/default/BondInterest]

Properties[Transaction/default/NotionalAmount]

Instrument custom properties, including derived properties. For example:
Properties[Instrument/X/Y]
Properties[Instrument/Y/X]


Instrument system properties, for example:
Properties[Instrument/default/Name]

Properties[Instrument/default/Scope]

Portfolio custom properties, including derived properties. For example:
Properties[Portfolio/X/Y]
Properties[Portfolio/Y/X]

Portfolio system properties, for example:
Properties[Portfolio/default/ModelFees]

Properties[Portfolio/default/FundFamily]

You can only reference components belonging to instruments in a formula for an instrument derived property.

Entity components

Belonging to instruments

Belonging to other types of entity

Stored data fields

Any for instruments except Href and Links. For example:
LusidInstrumentId
DomCcy
InstrumentDefinition.InstrumentType

Note: It is not possible to reference fields of the nested instrument definition other than InstrumentType.

N/A

Identifiers

For example:
Identifiers[ClientInternal]
Identifiers[Figi]
Identifiers[LusidInstrumentId]

N/A

Properties

Custom properties, including other derived properties. For example:
Properties[Instrument/X/Y]
Properties[Instrument/Y/X]

System properties, for example:
Properties[Instrument/default/Name] Properties[Instrument/default/Scope]

N/A

You can only reference components belonging to portfolios in a formula for a portfolio derived property.

Entity components

Belonging to portfolios

Belonging to other types of entity

Stored data fields

Any for portfolios except Href and Links. Nested fields can be referenced using dot notation. For example:
Id.Scope
Version.UserIdCreated
ParentPortfolioId.Code

N/A

Identifiers

N/A

N/A

Properties

Custom properties, including other derived properties. For example:
Properties[Portfolio/X/Y]
Properties[Portfolio/Y/X] 

System properties, for example:
Properties[Portfolio/default/FundFamily] Properties[Portfolio/default/ModelFees]

N/A

You can only reference components belonging to legal entities in a formula for a legal entity derived property.

Entity components

Belonging to legal entities

Belonging to other types of entity

Stored data fields

Any for legal entities except Href and Links. Nested fields can be referenced using dot notation. For example:
LusidLegalEntityId
DisplayName
CounterpartyRiskInformation.CountryOfRisk

N/A

Identifiers

For example:
Identifiers[LegalEntity/InternationalBanks/BankId]

Identifiers[LegalEntity/InvestmentFirms/InvestId]

N/A

Properties

Custom properties, including other derived properties. For example:
Properties[LegalEntity/X/Y]
Properties[LegalEntity/Y/X] 

System properties, for example:
Properties[LegalEntity/default/LEI]

N/A

You can only reference components belonging to person entities in a formula for a person derived property.

Entity components

Belonging to person entities

Belonging to other types of entity

Stored data fields

Any for person entities except Href and Links. Nested fields can be referenced using dot notation. For example:
LusidPersonId
DisplayName
Version.AsAtCreated

N/A

Identifiers

Identifiers[Person/PortfolioManagers/ManagerId]

Identifiers[Person/Traders/TraderId]

N/A

Properties

Custom properties, including other derived properties. For example:
Properties[Person/X/Y]
Properties[Person/Y/X]

N/A

You can create a custom metric to extend the set of LUSID metrics available to include in a valuation report.

To do this, create a derived property type in the special DerivedValuation domain. It does not belong to a type of entity as such, but rather can be reported in the same way as a LUSID metric. See an example.

You can reference components belonging to certain entities, and also certain LUSID and other custom metrics, in a formula for a custom metric.

Components

Belonging to instruments

Belonging to holdings

Belonging to portfolios or portfolio groups

LUSID metrics

Stored data fields

Any for instruments except Href and Links, prefixed by Instrument. Nested fields can be referenced using dot notation. For example:
Instrument.LusidInstrumentId
Instrument.DomCcy
Instrument.InstrumentDefinition.InstrumentType

Note: It is not possible to reference fields of the nested instrument definition other than InstrumentType.

Any for holdings, prefixed by PortfolioHolding. Nested fields can be referenced using dot notation. For example:
PortfolioHolding.InstrumentUid
PortfolioHolding.HoldingType
PortfolioHolding.Cost.Currency

N/A

N/A

Identifiers

Any prefixed by Instrument. For example:
Instrument.Identifiers[ClientInternal]
Instrument.Identifiers[Figi]
Instrument.Identifiers[LusidInstrumentId]

N/A

N/A

N/A

Sub-holding keys (SHKs)

N/A

Any prefixed by PortfolioHolding. For example:
PortfolioHolding.SubHoldingKeys[Transaction/X/Y]
PortfolioHolding.SubHoldingKeys[Transaction/Y/X]

N/A

N/A

Properties

Custom properties, including other derived properties. For example:
Properties[Instrument/X/Y]
Properties[Instrument/Y/X] 

System properties, for example:
Properties[Instrument/default/Name] Properties[Instrument/default/Scope]

Custom properties, including other derived properties. For example:
Properties[Holding/X/Y]
Properties[Holding/Y/X]

System properties, for example:
Properties[Holding/default/SourcePortfolioId]
Properties[Holding/default/SourcePortfolioScope]

Custom properties, including other derived properties. For example:
Properties[Portfolio/X/Y]
Properties[PortfolioGroup/Y/X] 

System properties, for example:
Properties[Portfolio/default/ModelFees]
Properties[Portfolio/default/FundFamily]

N/A

Metrics

N/A

N/A

N/A

Any with an underlying (flattened) data type of string, decimal, int, bool or datetime, including other custom metrics. For example:
AddressKeys[Valuation/PV]

AddressKeys[Holding/Cost/Pfolio]

AddressKeys[DerivedValuation/MyDerivedProps/AdjustedExposure]