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

# TRADEPNLS

The TRADEPNLS table contains some of the attributes of the PnL data used as inputs for VaR and ES computations.

If you are using a database that does not [support native vector aggregation](https://docs.activeviam.com/products/atoti/server/6.1.11/docs/directquery/directquery-vectors/#native-support),
the PNL\_VECTOR field is omitted and the vectors are present in the [TRADEPNLS\_VECTOR](./tradepnls_vector) table.

| Column Name       | Type            | Not Null | Cube Field                                  | Description                                                                                                                                                                                                                                                                                                                                                                                     |
| ----------------- | --------------- | -------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AS\_OF\_DATE      | DATE            | Y        |                                             | Timestamp (at close of business) for the data.                                                                                                                                                                                                                                                                                                                                                  |
| TRADE\_KEY        | STRING          | Y        |                                             | The field contains the `tradeID` for full data or `Book#VaR Inclusion` for summary data.                                                                                                                                                                                                                                                                                                        |
| TRADE\_ID         | STRING          | Y        | [Trades](../cube/dimensions/booking)        | If TradeId comes from multiple systems you may need to prepend source system to the ID for uniqueness. Note that in certain cases, the TradeId could be for adjustment purposes. In such cases we might only have one PnL vector per Book or desk. The TradeId should contain this information clearly (ADDON or ADJ). Example: âADDON\_IR\_IRSWAP\_LIBOR3Mâ, âADJ\_EQ\_12345677â, etc. |
| SCENARIO\_SET     | STRING          | Y        | [Scenario Sets](../cube/dimensions/risk)    | Name of the scenario set for the PnL vector.                                                                                                                                                                                                                                                                                                                                                    |
| CALCULATION\_ID   | STRING          | Y        | [CalculationIds](../cube/dimensions/risk)   | Name of the PnL vector calculation run. There may be several runs per AsOfDate.                                                                                                                                                                                                                                                                                                                 |
| MARKET\_DATA\_SET | STRING          | Y        | This field is not currently used            | The market data set that should be used when retrieving rates for FX conversion.                                                                                                                                                                                                                                                                                                                |
| RISK\_FACTOR      | STRING          | Y        | [Risk Factors](../cube/dimensions/risk)     | Underlying risk factor (may be more than one) of the risk class.                                                                                                                                                                                                                                                                                                                                |
| RISK\_CLASS       | STRING          | Y        | [Risk Classes](../cube/dimensions/risk)     | Defines the risk class that the PnL vector is computed for.                                                                                                                                                                                                                                                                                                                                     |
| SENSITIVITY\_NAME | STRING          | Y        |                                             | Name of the sensitivity that the PnL is attributed to.                                                                                                                                                                                                                                                                                                                                          |
| CCY               | STRING          | Y        | [Currencies](../cube/dimensions/currencies) | Currency in which the PnL values are expressed.                                                                                                                                                                                                                                                                                                                                                 |
| MTM               | DOUBLE          |          |                                             | The mark-to-market value of the trade.                                                                                                                                                                                                                                                                                                                                                          |
| PNL\_VECTOR       | `ARRAY<DOUBLE>` |          |                                             | The PnL vector for the trade. This field is omitted if the database does not support [native vector aggregation](https://docs.activeviam.com/products/atoti/server/6.1.11/docs/directquery/directquery-vectors/#native-support).                                                                                                                                                                |

## Unique Key

<table><thead><tr><th>Columns</th></tr></thead><tbody><tr><td>AS\_OF\_DATE</td></tr><tr><td>TRADE\_KEY</td></tr><tr><td>SCENARIO\_SET</td></tr><tr><td>CALCULATION\_ID</td></tr><tr><td>MARKET\_DATA\_SET</td></tr><tr><td>RISK\_FACTOR</td></tr></tbody></table>

## Incoming Joins

<table><thead><tr><th>Target Table</th><th>Source Columns</th><th>Target Columns</th></tr></thead><tbody><tr><td><a href="./tradepnls_vector">TRADEPNLS\_VECTOR</a></td><td>AS\_OF\_DATE<br />TRADE\_KEY<br />SCENARIO\_SET<br />CALCULATION\_ID<br />MARKET\_DATA\_SET<br />RISK\_FACTOR<br /></td><td>AS\_OF\_DATE<br />TRADE\_KEY<br />SCENARIO\_SET<br />CALCULATION\_ID<br />MARKET\_DATA\_SET<br />RISK\_FACTOR<br /></td></tr></tbody></table>

## Outgoing Joins

<table><thead><tr><th>Target Table</th><th>Source Columns</th><th>Target Columns</th></tr></thead><tbody><tr><td><a href="./trade_attributes">TRADE\_ATTRIBUTES</a></td><td>AS\_OF\_DATE<br />TRADE\_KEY</td><td>AS\_OF\_DATE<br />TRADE\_KEY</td></tr><tr><td><a href="./risk_factors_catalogue">RISK\_FACTORS\_CATALOGUE</a></td><td>AS\_OF\_DATE<br />RISK\_FACTOR</td><td>AS\_OF\_DATE<br />RISK\_FACTOR\_ID</td></tr></tbody></table>
