You can create a derived property type to define the core characteristics of derived properties of that type, in particular the entity type to which they belong and the derivation formula. See how to create a standard property type.
A derived property type specifies:
A 3-stage key (for example,
Instrument/Derived/Domicile
) used to retrieve derived properties for entities, where:The first stage is the domain and determines the entity type to which derived properties belong, in this case instruments.
The second stage is the scope (or namespace); this can be used to partition derived properties, and/or entitle them so only people with suitable permissions can see them.
The third stage is the code; this must be unique within the scope.
A derivation formula that instructs LUSID how to automatically calculate derived property values.
A data type that matches the data returned by the derivation formula. This should be one of the primitive data types
string
,number
,boolean
ordate
.
Note: Once created, you can use the UpdateDerivedPropertyDefinition API to change most characteristics. Be aware that if you change the derivation formula you may also need to change the data type to match.
Using the LUSID REST API
Call the LUSID CreateDerivedPropertyDefinition API and specify in the request body:
A
domain
that corresponds to the entity type to which derived properties belong (see a complete list), for exampleInstrument
.A
scope
that is unique within thedomain
. This value is case-sensitive.A
code
that is unique within thescope
. This value is case-sensitive.A user-friendly
displayName
.A
scope
ofsystem
and acode
of eitherstring
,number
,boolean
ordate
.A
derivationFormula
that performs one or more operations on one or more existing data fields or properties.
For example, to create a derived property type with a 3-stage key of Instrument/Derived/Domicile
that normalises countries to a standard set of codes:
Providing the request is successful, the response confirms the 3-stage key (highlighted in red):
You can now retrieve instruments from LUSID with their derived properties, at which point LUSID automatically calculates derived property values.
Using Luminesce
You can use the Lusid.Property.Definition.Writer provider.
Using the LUSID web app
Sign in to the LUSID web app using the credentials of a LUSID administrator.
From the top left menu, select Data Management > Properties.
Click the Create Property button (top right).
Fill out all the fields on the Basic data screen of the Create Property dialog:
On the Property screen of the dialog, choose Derived property.
Select a Data type of either
String[system]
,Number[system]
,Boolean[system]
orDate[system]
.Specify a Derivation formula:
Click the Create button to create the derived property type. You can now retrieve instruments from LUSID with their derived properties, at which point LUSID automatically calculates derived property values.