You can add one or more general ledger profiles, each containing any number of mappings, to an existing 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.
Methods
Call the 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:
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:
Write a Luminesce SQL query using the Lusid.GeneralLedgerProfile.Writer provider to create a general ledger profile and the Lusid.GeneralLedgerProfile.Mapping.Writer provider to set mappings, and execute the query using a tool such as the LUSID web app:
Data fields
This section supplements the API documentation 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.
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 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.
To delete a profile, call the 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.
Mapping filter expressions
The syntax of a mappingFilter
expression is:
<attribute> <operator> <value>
...where:
<attribute>
is a field, property or other data item to test against. Allowed values areGeneralLedgerAccountCode
and all the attributes in this table.<operator>
is one of the LUSID filter operators.<value>
is a value appropriate to the data type of<attribute>
.
Note the following:
A
mappingFilter
expression is case-insensitive.A string
<value>
must be enclosed in single straight quote marks (the%27
UTF-8 encoding).You can concatenate expressions using the
and
andor
operators, for example:GeneralLedgerAccountCode eq '1-Investments' and subholdingkeys[Transaction/Ibor/Strategy] eq 'Income'
If you use both, standard boolean operator precedence 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 | Syntax example | Notes |
---|---|---|
| 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. | |
| LUSID automatically categorises a journal entry line into a broad economic bucket. More information. | |
| The currency of the instrument underlying the journal entry line, if specified. | |
A sub-holding key on a portfolio |
| Under-the-hood, a SHK is defined as a custom property with a 3-stage key in the |
A portfolio field |
| This can be any of the stored fields for a portfolio except the |
A portfolio property |
| This can be any property with a 3-stage key in the Portfolio domain. |
An instrument field |
| This can be any of the stored fields for an instrument except the |
An instrument property |
| This can be any property with a 3-stage key in the |
A transaction field |
| This can be any of the stored fields for a transaction, prefixed by |
A transaction property |
| This can be any property with a 3-stage key in the |
An account field |
| This can be any of the stored fields for an account, prefixed by |
An account property |
| This can be any property with a 3-stage key in the |
A fund property |
| This can be any property with a 3-stage key in the |
An ABOR property (V1 funds only) |
| This can be any property with a 3-stage key in the |