---
title: "Lusid.Portfolio.Txn"
slug: "lusidportfoliotxn"
updated: 2024-10-30T10:57:11Z
published: 2024-10-30T10:57:11Z
canonical: "support.lusid.com/lusidportfoliotxn"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lusid.Portfolio.Txn

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Read | FINBOURNE | Provided with LUSID |

Providing you have sufficient [access control permissions](/v1/docs/creating-policies-to-control-access-to-providers-for-different-luminesce-end-users), the `Lusid.Portfolio.Txn` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that retrieves [input transactions](/v1/docs/input-and-output-transactions) from one or more transaction portfolios.

> [!NOTE]
> **Note**: By default, `Lusid.Portfolio.Txn` cannot retrieve properties for transactions. To do this, you must first configure `Lusid.Portfolio.Txn` to 'inline' properties. [See how to do this](/v1/docs/how-do-i-configure-luminesce-entity-providers-to-readwrite-properties).

**See also:** [Lusid.Portfolio.Txn.Writer](/v1/docs/lusidportfoliotxnwriter), [Lusid.Portfolio.Txn.Output](/v1/docs/lusidportfoliotxnoutput)

## Basic usage

```sql
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](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
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](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

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

> [!NOTE]
> **Note:** Fields marked 'main' are returned by queries that select a `^` character, for example `select ^ from Lusid.Portfolio.Txn`.

## Examples

> [!NOTE]
> **Note:** For more example Luminesce SQL queries, visit our [Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples).

### Example 1: Retrieve all transactions in every portfolio

```sql
select * from Lusid.Portfolio.Txn
```

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

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

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

```sql
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](/v1/docs/how-do-i-configure-luminesce-entity-providers-to-readwrite-properties) 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](/v1/docs/retrieving-properties-from-the-domains-of-other-types-of-entity) such as `Instrument` in addition to the native `Transaction` domain.

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