---
title: "How do I add a general ledger profile with mappings to a chart of accounts?"
slug: "how-do-i-add-a-general-ledger-profile-with-mappings-to-a-chart-of-accounts"
updated: 2025-10-28T08:45:22Z
published: 2025-10-28T08:45:22Z
canonical: "support.lusid.com/how-do-i-add-a-general-ledger-profile-with-mappings-to-a-chart-of-accounts"
---

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

# How do I add a general ledger profile with mappings to a chart of accounts?

You can add one or more general ledger profiles, each containing any number of mappings, to an existing [chart of accounts](/v1/docs/how-do-i-create-a-chart-of-accounts) (CoA).

Note the **order in which mappings are specified** in a profile is significant. For each journal entry line, LUSID uses the first matching mapping found to assign journal entry lines to levels in order to [break down account activity in a trial balance](/v1/docs/using-a-general-ledger-profile-to-break-down-account-activity-in-a-trial-balance).

## Methods

LUSID web appLUSID APILuminesce

Call the [CreateGeneralLedgerProfile](https://www.lusid.com/docs/api/lusid/endpoints/chart-of-accounts/CreateGeneralLedgerProfile) API.

Note in this example, the third mapping with a `mappingFilter` expression set to `True` is a 'catch all' that applies levels to hitherto unmatched journal entry lines; without this, unmatched journal entry lines would have no levels:

```json
curl -X POST 'https://<your-domain>.lusid.com/api/api/chartofaccounts/CoAs/DailyCoA/generalledgerprofile'
  -H 'Content-Type: application/json-patch+json'
  -H 'Authorization: Bearer <your-API-access-token>'
  -d '{
  "generalLedgerProfileCode": "STEM",
  "displayName": "STEM",
  "description": "STEM profile",
  "generalLedgerProfileMappings": [
    {
      "mappingFilter": "GeneralLedgerAccountCode eq '1-Investments'",
      "levels": [
        "DefaultCurrency"
      ]
    },
    {
      "mappingFilter": "EconomicBucket startswith 'PL_' and Properties[Instrument/default/LusidInstrumentId] startswith 'CCY_'",
      "levels": [
        "SourceType", "EconomicBucket", "ActivityDate"
      ]
    },
    {
      "mappingFilter": "True",
      "levels": [
        "Instrument.AssetClass"
      ]
    }
  ]
}'
```

Navigate to **Fund Accounting > Chart of Accounts**, open the **General Ledger Profiles** tab, select the parent CoA and click the **Create general ledger profile** button:

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(431).png)

Write a Luminesce SQL query using the [Lusid.GeneralLedgerProfile.Writer](/v1/docs/lusidgeneralledgerprofilewriter) provider to create a general ledger profile and the [Lusid.GeneralLedgerProfile.Mapping.Writer](/v1/docs/lusidgeneralledgerprofilemappingwriter) provider to set mappings, and execute the query using a tool such as the LUSID web app:

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(969).png)

## Data fields

This section supplements the [API documentation](https://www.lusid.com/docs/api/lusid/endpoints/chart-of-accounts/CreateGeneralLedgerProfile) and on-screen help text in the LUSID web app.

A profile is identified by a `code` that must be unique within the parent CoA.

You can specify any number of `generalLedgerProfileMappings` that match journal entry lines to *levels* (that is, categories to divide accounts into). Note the order is significant. Each mapping consists of:

- A `mappingFilter` expression that describes criteria for matching journal entry lines.
- Up to five `levels` to apply to journal entry lines matching those criteria, specified as an ordered list of strings. [Syntax and allowed values](/v1/docs/how-do-i-add-a-general-ledger-profile-with-mappings-to-a-chart-of-accounts#syntax-of-a-general-ledger-profile-mapping).

## Subsequent updates

Once a profile is created, you cannot change the `code`, `displayName` or `description`.

You *can* specify a new ordered set of mappings using the [SetGeneralLedgerProfileMappings](https://www.lusid.com/docs/api#operation/SetGeneralLedgerProfileMappings) API; note the new set replaces the existing set, so include any mappings you want to retain in the request.

You *can* change the order of mappings in the LUSID web app using the grab handles (in red). You cannot currently patch a profile using the LUSID API.

![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(971).png)

To delete a profile, call the [DeleteGeneralLedgerProfile](https://www.lusid.com/docs/api/lusid/endpoints/chart-of-accounts/DeleteGeneralLedgerProfile) API.

## Syntax of a general ledger profile mapping

Each general ledger profile mapping consists of:

- A `mappingFilter` expression that describes criteria for matching journal entry lines. See below.
- Up to five `levels` to apply to journal entry lines matching those criteria, specified as an ordered list. [More information](/v1/docs/how-do-i-add-a-general-ledger-profile-with-mappings-to-a-chart-of-accounts#levels).

### Mapping filter expressions

The syntax of a `mappingFilter` expression is:

`&lt;attribute&gt; &lt;operator&gt; &lt;value&gt;`

...where:

- `&lt;attribute&gt;` is a field, property or other data item to test against. Allowed values are `GeneralLedgerAccountCode` and [all the attributes in this table](/v1/docs/how-do-i-add-a-general-ledger-profile-with-mappings-to-a-chart-of-accounts#levels).
- `&lt;operator&gt;` is one of the [LUSID filter operators](/v1/docs/filtering-information-retrieved-from-lusid#appendix-a-supported-operators).
- `&lt;value&gt;` is a value appropriate to the data type of `&lt;attribute&gt;`.

Note the following:

- A `mappingFilter` expression is case-insensitive.
- A string `&lt;value&gt;` must be enclosed in single straight quote marks (the `%27` UTF-8 encoding).
- You can concatenate expressions using the `and` and `or` operators, for example: `GeneralLedgerAccountCode eq '1-Investments' and subholdingkeys[Transaction/Ibor/Strategy] eq 'Income'`

If you use both, [standard boolean operator precedence](/v1/docs/filtering-information-retrieved-from-lusid#logical-operators) applies: `EconomicBucket startswith 'NA' or (DefaultCurrency in 'GBP', 'USD' and HoldType eq 'P')`

### Levels

You can specify up to five levels as an ordered, comma-separated list of strings. In the following example, `Instrument.AssetClass` is the first (or most significant) level, and `Account.type` the last (or least):

`["Instrument.assetClass", "Properties[Portfolio/Ibor/Region]", "DefaultCurrency", "EconomicBucket", "Account.type"]`

| **Available** `&lt;levels&gt;` | **Syntax example** | **Notes** |
| --- | --- | --- |
| `ActivityDate` | `ActivityDate gt 2023-01-01` | For a journal entry line originating from a transaction, this is the trade date. For a journal entry line originating from a valuation, this is the date of the latest detected change to market data. |
| `EconomicBucket` `EconomicBucketComponent` `EconomicBucketVariant` | `EconomicBucket startswith 'PL_Real'` `EconomicBucketComponent eq 'CrossGainLoss'` `EconomicBucketVariant eq 'ShortTerm` | LUSID automatically categorises every journal entry line into a broad economic bucket. Some economic buckets are further categorised into components and variants. [More information](/v1/docs/what-are-economic-buckets). |
| `DefaultCurrency` | `DefaultCurrency in 'GBP','USD'` | The currency of the instrument underlying the journal entry line, if specified. |
| A [sub-holding key](/v1/docs/how-do-i-register-sub-holding-keys-shks-with-a-portfolio) on a portfolio | `subholdingkeys[Transaction/Ibor/Strategy] eq 'Strategy'` | Under-the-hood, a SHK is defined as a [custom property](/v1/docs/properties) with a 3-stage key in the `Transaction` domain. |
| A portfolio field | `Portfolio.displayName eq 'UK-Equities'` `NamePortfolio.parentPortfolioId.Code eq 'FixedIncome'` | This can be any of the [stored fields for a portfolio](https://www.lusid.com/docs/api/lusid/schemas/Portfolio) except the `href`, `links` and `version` fields, prefixed by `Portfolio.` Nested fields can be accessed using dot notation. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/9b7b416e-605b-4346-8d6b-cc9b8644222a.png) |
| A portfolio property | `properties[Portfolio/Ibor/Manager] in 'John Smith','Jane Jones'` | This can be any property with a 3-stage key in the Portfolio domain. |
| An instrument field | `Instrument.identifiers['LusidInstrumentId'] eq 'LUID_ZZZZZZZZ'` `Instrument.instrumentDefinition.instrumentType in 'Equity','Bond'` | This can be any of the [stored fields for an instrument](https://www.lusid.com/docs/api/lusid/schemas/Instrument) except the `href`, `links` and `version` fields, prefixed by `Instrument.` Nested fields can be accessed using dot notation. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/5a949458-f7cd-4455-ba67-be5ce9a4cb5d.png) |
| An instrument property | `properties[Instrument/Ibor/AnalystRating] any (~ startswith 'A')` | This can be any property with a 3-stage key in the `Instrument` domain. |
| A transaction field | `Transaction.totalConsideration.amount gt 2000` | This can be any of the [stored fields for a transaction](https://www.lusid.com/docs/api/lusid/schemas/Transaction), prefixed by `Transaction.` Nested fields can be accessed using dot notation. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/1244c7f3-ed46-404f-bbf6-7e098c0f27c3.png) |
| A transaction property | `properties[Transaction/Ibor/Broker] eq 'AcmeCorp'` | This can be any property with a 3-stage key in the `Transaction` domain. |
| An account field | `Account.type in 'Asset','Liabilities'` | This can be any of the [stored fields for an account](https://www.lusid.com/docs/api/lusid/schemas/Account), prefixed by `Account.` Nested fields can be accessed using dot notation. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/b91ef994-b388-4c54-8c6d-57c459887ecf.png) |
| An account property | `properties[Account/Type/AssetClass] eq 'Equity'` | This can be any property with a 3-stage key in the `Account` domain. |
| A fund property | `properties[Fund/Managers/Name] eq 'Fred Bloggs'` | This can be any property with a 3-stage key in the `Fund` domain. |
| An ABOR property (V1 funds only) | `properties[Abor/Client/Accountant] not in 'Fred Bloggs', 'Sarah Smart'` | This can be any property with a 3-stage key in the `Abor` domain. |

## 

##
