--- title: "Strategy-tagging transactions using sub-holding keys (SHKs)" slug: "strategy-tagging-transactions-using-sub-holding-keys-shks" tags: ["sub holding keys", "strategy", "tagging"] updated: 2024-08-20T13:13:10Z published: 2024-08-20T13:13:10Z canonical: "support.lusid.com/strategy-tagging-transactions-using-sub-holding-keys-shks" --- > ## 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. # Strategy-tagging transactions using sub-holding keys (SHKs) You can tag any transaction in a transaction portfolio with a value for one or more of the [sub-holding keys](/v1/docs/what-is-a-sub-holding-key-shk) (SHKs) registered with that portfolio. Tags are retained throughout the investment lifecycle and workflow. By default, LUSID reports holdings for a portfolio at the instrument level, so all transactions impacting an underlying instrument such as BP contribute to a calculation of your current position (quantity and cost) in a single BP holding. Consider the following set of transactions upserted to a portfolio: | **Date** | **Instrument** | **Transaction Type** | **Quantity** | | --- | --- | --- | --- | | 20 May 2023 | BP | `Buy` | 100 | | 21 May 2023 | BP | `Buy` | 150 | | 22 May 2023 | BP | `Buy` | 50 | | 23 May 2023 | BP | `Sell` | 50 | When you generate a holdings report after 23 May, LUSID calculates you have a single holding of 250 BP shares. You could instead tag the same set of transactions with distinct values for an SHK representing investment strategies, for example: | **Date** | **Instrument** | **Transaction Type** | **Quantity** | **Strategy** | | --- | --- | --- | --- | --- | | 20 May 2023 | BP | `Buy` | 100 | Growth | | 21 May 2023 | BP | `Buy` | 150 | Income | | 22 May 2023 | BP | `Buy` | 50 | Growth | | 23 May 2023 | BP | `Sell` | 50 | Income | This time, LUSID calculates you have two separate BP holdings, one in a Growth strategy with 150 shares and one in an Income strategy with 100 shares. For an in-depth demonstration, work through this tutorial on [setting up a strategy-based transaction portfolio](/v1/docs/creating-a-strategy-based-transaction-portfolio). Under-the-hood, an SHK is a *custom property*. To tag a transaction, you must first [set up the SHK](/v1/docs/what-is-a-sub-holding-key-shk#shk-setup), which means creating an underlying property type and registering it with the portfolio. Then, you can add the SHK property and an appropriate value to a transaction: - When you create that transaction using the `BatchUpsertTransactions` API. [See an example](/v1/docs/how-do-i-create-or-update-a-transaction#using-the-lusid-rest-api). - Subsequently by updating transaction properties using the [UpsertTransactionProperties](https://www.lusid.com/docs/api/#operation/UpsertTransactionProperties) API, for example for `Txn-0000001`: ```json curl -X POST 'https://.lusid.com/api/api/transactionportfolios/Finbourne-Examples/Global-Equity/transactions/Txn-0000001/properties'  -H 'Content-Type: application/json-patch+json'  -H 'Authorization: Bearer '  -d '{  "Transaction/SHKs/Strategy": {    "key": "Transaction/SHKs/Strategy",    "value": {      "labelValue": "Growth"    }  } }' ``` > **Note**: Do *not* use `BatchUpsertTransactions` to update an existing transaction's properties, since any properties omitted from the API request are deleted rather than augmented.