Lusid.Portfolio.Txn.Output

Type

Read/write

Author

Availability

Data provider

Read

Finbourne

Provided with LUSID

Providing you have sufficient access control permissions, the Lusid.Portfolio.Txn.Output provider enables you to write a Luminesce SQL query that retrieves output transactions from one or more transaction portfolios.

Note: By default, Lusid.Portfolio.Txn.Output cannot retrieve properties for output transactions. To do this, you must first configure Lusid.Portfolio.Txn.Output to 'inline' properties. See how to do this.

Note that multiple records may be returned for a sell-like transaction for which LUSID generates multiple gain/loss calculations, for example market gain/loss and FX gain/loss.

See also: Lusid.Portfolio.Txn

Basic usage

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

Query parameters

Lusid.Portfolio.Txn.Output 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.Output' and FieldType = 'Parameter';

Data fields

By default, Lusid.Portfolio.Txn.Output 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.Output' and FieldType = 'Column';

Note: Fields marked 'main' are returned by queries that select a ^ character, for example select ^ from Lusid.Portfolio.Txn.Output.

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.Output

Example 2: Retrieve all transactions from a particular date in portfolios in a particular scope

select * from Lusid.Portfolio.Txn.Output where PortfolioScope = 'Finbourne-Examples' and FromEffectiveAt = #2022-01-01#

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

select * from Lusid.Portfolio.Txn.Output 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.Output 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 other domains such as Instrument in addition to the native Transaction domain.

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