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

# PNL

The PNL table contains Profit & Loss and Product Control data.

| Column Name | Type | Not Null | Default Value[^1] | Cube Field | Description |
| - | - | - | - | - | - |
| AS\_OF\_DATE | DATE | Y | | | Timestamp (at close of business) for the data. |
| TRADE\_KEY | STRING | Y | N/A | | The field contains the `tradeID` for full data, or `Book#VaR Inclusion#PLDriver` for summary data. |
| TRADE\_ID | STRING | Y | *DATAMEMBER* | [Trades](https://docs.activeviam.com/solutions/market-risk/6.0/cube/dimensions/booking.md) | If TRADE\_ID comes from multiple systems, you may need to prepend source system to the ID for uniqueness. \[!NOTE] In certain cases, the TRADE\_ID could be for adjustment purposes. In such cases we might only have one PnL vector per Book or desk. The TRADE\_ID should contain this information clearly (ADDON or ADJ). Example: "IR\_IRSWAP\_LIBOR3M", "EQ\_12345677", etc. |
| DAILY | DOUBLE | Y | 0 | | The DTD PnL value. |
| MONTHLY | DOUBLE | Y | 0 | | The MTD PnL value. |
| YEARLY | DOUBLE | Y | 0 | | The YTD PnL value. |
| LIFETIME | DOUBLE | Y | 0 | | The LTD PnL value. |
| TYPE | STRING | Y | N/A | [Types](https://docs.activeviam.com/solutions/market-risk/6.0/cube/dimensions/pnl.md) | The type of PnL.Example: 'Actual PL' |
| PLDRIVER | STRING | Y | N/A | [PL Drivers](https://docs.activeviam.com/solutions/market-risk/6.0/cube/dimensions/pnl.md) | Driver for the PnL value.Example: 'Market moves' |
| IS\_FULL\_REVAL | STRING | Y | N/A | [IsFullRevals](https://docs.activeviam.com/solutions/market-risk/6.0/cube/dimensions/pnl.md) | Indicates whether the PnL comes from a full revaluation in the risk engine. |
| CCY | STRING | Y | N/A | [Currencies](https://docs.activeviam.com/solutions/market-risk/6.0/cube/dimensions/currencies.md) | The currency of the PnL value. |
| MARKET\_DATA\_SET | STRING | Y | N/A | This field is not currently used | The market data set that should be used when retrieving rates for FX conversion. |
| BUCKET | STRING | Y | N/A | [Buckets](https://docs.activeviam.com/solutions/market-risk/6.0/cube/dimensions/pnl.md) | Placeholder for a set of risk factors that are grouped together by common characteristics. |
| LEG\_ID | STRING | N | N/A | [Legs](https://docs.activeviam.com/solutions/market-risk/6.0/cube/dimensions/booking.md) | Optional input to send in trades that will have multiple legs under a single TradeId. Only available when the property [`mr.pnl.enable.leg-id`](../properties/config-properties/mr-pnl-config) is set to true. If using this field, please update your SQL script to include it. |

## Unique Key

| Columns |
| - |
| AS\_OF\_DATE |
| TRADE\_KEY |
| TYPE |
| MARKET\_DATA\_SET |

## Outgoing Joins

| Target Table | Source Columns | Target Columns |
| - | - | - |
| [TRADE\_ATTRIBUTES](https://docs.activeviam.com/solutions/market-risk/6.0/database/trade_attributes.md) | AS\_OF\_DATE TRADE\_KEY | AS\_OF\_DATE TRADE\_KEY |

[^1]: If the default value is marked as empty, it means that the default value is 'null' for nullable fields, and that a value needs to be explicitly set for non-nullable fields.
