Views:
TypeRead/writeAuthorAvailability
Data providerReadFinbourneProvided with LUSID

The Lusid.Property provider enables you to write a Luminesce SQL query that retrieves custom properties for either:

The syntax and behavior of this provider differs depending on the entity type.

Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and read entity and property data stored in LUSID. This should automatically be the case if you are the domain owner.

See also: Lusid.Property.Writer

Portfolios and portfolio groups

In your query you must specify either:

  • The EntityScope and EntityId fields to identify the scope and code of a portfolio or portfolio group whose properties to return.
  • The PropertyScope and PropertyCode fields to identify the scope and code of a property whose parent portfolios or portfolio groups to return.

For example, to retrieve all the properties for a particular portfolio:

select * from Lusid.Property where Domain = 'Portfolio' 
and EntityScope = 'Finbourne-Examples' and EntityId = 'UK-Equities';

To retrieve all the portfolio groups that have a particular property:

select * from Lusid.Property where Domain = 'PortfolioGroup'
and PropertyScope = 'FundManagers' and PropertyCode = 'Name';

To retrieve all properties for all portfolios:

select prop.*
from Lusid.Portfolio port
inner join Lusid.Property prop
  on prop.Domain = 'Portfolio'
  and prop.EntityScope = port.PortfolioScope
  and prop.EntityId = port.PortfolioCode;

Instruments

In your query you must specify either:

  • The EntityIdType and EntityId fields to identify an instrument whose properties to return. The EntityIdType field refers to a unique instrument identifier, and the EntityId field to a valid value for that identifier.
  • The PropertyScope and PropertyCode fields to identify the scope and code of a property whose instruments to return.

Specify the EntityScope field as well if instruments are mastered in a custom instrument scope (otherwise only the built-in default scope is searched).

For example, to retrieve all the properties for a particular instrument identified by LUID:

select * from Lusid.Property where Domain = 'Instrument' 
and EntityIdType = 'LusidInstrumentId' and EntityId = 'LUID_G67H99J6';

To retrieve all the properties for a particular instrument identified by FIGI and mastered in a custom scope:

select * from Lusid.Property where Domain = 'Instrument' and EntityScope = 'my-custom-instrument-scope'
and EntityIdType = 'Figi' and EntityId = 'BBG000BDZGH6';

To retrieve all the instruments in the default scope that have a particular property:

select * from Lusid.Property where Domain = 'Instrument'
and PropertyScope = 'Ibor' and PropertyCode = 'GICSSector';

To retrieve a history of values for a particular time-variant property property for a particular entity, specify the GetHistorical query parameter:

select * from Lusid.Property where Domain = 'Instrument'
and EntityIdType = 'LusidInstrumentId' and EntityId = 'LUID_G67H99J6'
and PropertyScope = 'Ibor' and PropertyCode = 'AnalystRating' and GetHistorical = True;

To retrieve all the properties for all the equity instruments in the default scope:

select * from Lusid.Property where Domain = 'Instrument'
and EntityIdType = 'LusidInstrumentId' and EntityId in
(select LusidInstrumentId from Lusid.Instrument.Equity);

Persons and legal entities

In your query you must specify the EntityScope, EntityIdType and EntityId fields to identify a person or legal entity whose properties to return. These fields refer to the three components of a user-specified identifier for these entity types: idTypeScopeidTypeCode and code respectively.

Note: You cannot reverse this operation and specify the PropertyScope and PropertyCode fields to look up all the people or legal entities that have a particular property.

For example, to retrieve all the properties for a person whose identifier has an idTypeScope of PortfolioManagers, an idTypeCode of ManagerId and a code of PortMan1:

select * from Lusid.Property where Domain = 'Person'
and EntityScope = 'PortfolioManagers' and EntityIdType = 'ManagerId' and EntityId = 'PortMan1';

Note: Since an identifier is defined under-the-hood as a property type with a 3-stage key, this query returns the identifier as well.

To retrieve all the properties for a particular legal entity:

select * from Lusid.Property where Domain = 'LegalEntity'
and EntityScope = 'InternationalBanks' and EntityIdType = 'BankId' and EntityId = 'Bank1';

To retrieve all the properties for all the people identified as portfolio managers:

select prop.*
from Lusid.Person per
inner join Lusid.Property prop
  on prop.Domain = 'Person'
  and prop.EntityScope = 'PortfolioManagers'
  and prop.EntityIdType = 'ManagerId'
  and prop.EntityId = per.PortManId;

Note: This query relies on prior configuration of the Lusid.Person provider to inline the PortManId identifier as a field