Views:
TypeRead/writeAuthorAvailability
Data providerReadFinbourneProvided with LUSID

The Lusid.Portfolio.Txn provider enables you to write a Luminesce SQL query that retrieves transactions from one or more LUSID portfolios.

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

See also: Lusid.Portfolio.Txn.Writer

Basic usage

select * from Lusid.Portfolio.Txn where <filter-expression>;

Query parameters

Lusid.Portfolio.Txn has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Lusid.Portfolio.Txn' and FieldType = 'Parameter';

Data fields

By default, Lusid.Portfolio.Txn returns a table of data populated with particular fields (columns). You can return a subset of these fields.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:

select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Lusid.Portfolio.Txn' and FieldType = 'Column';


Note: Fields marked 'main' are returned by queries that start select ^ from Lusid.Portfolio.Txn...

Examples

Note: For more example Luminesce SQL queries, visit our Github repo.

Example 1: Retrieve all transactions in every portfolio

select * from Lusid.Portfolio.Txn

Example 2: Retrieve all transactions in portfolios within a particular scope

select * from Lusid.Portfolio.Txn where PortfolioScope = 'Finbourne-Examples'

Example 3: Retrieve all transactions for a particular portfolio, including cancelled transactions

select * from Lusid.Portfolio.Txn where PortfolioScope = 'Finbourne-Examples' and PortfolioCode = 'UK-Equities' and ShowNonActive = true

Example 4: Retrieve all transactions for a particular portfolio, including properties

To retrieve properties for transactions, Lusid.Portfolio.Txn must have been configured to 'inline' the chosen properties (in this case BrokerCommission) into the standard set of transaction fields. Note it is possible to retrieve properties from the Portfolio and Instrument domains as well as native Transaction domain properties.

select * from Lusid.Portfolio.Txn where PortfolioScope = 'Finbourne-Examples' and PortfolioCode = 'UK-Equities' and BrokerCommission > 20