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

# Adjustments in the DirectQuery database

Sign-Off isn’t supported with DirectQuery, but you may want to deploy a cluster in which there is:

* one data node that contains in-memory data and for which Sign-Off features are enabled
* one DirectQuery data node

For this deployment, two options are possible depending on whether adjustment fields are present in the DirectQuery database:

## Option 1: Adjustment fields not present

In this case, the DirectQuery database is used without any modifications to its schema.

In this setup, to enable horizontal distribution on the data node, use the following configuration for the DirectQuery data node, in addition to the settings already defined:

<table><thead><tr><th>Property</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><code>configuration.sign-off.enabled</code></td><td>true</td><td>Flag used to enable Sign-Off related features</td></tr><tr><td><code>directquery.with-adjustments</code></td><td>false</td><td>This property is only taken into account if the property <code>configuration.sign-off.enabled</code> is <code>true</code>. Specify if columns handling adjustments (<code>SOURCE</code> and <code>INPUT\_TYPE</code>) are present in the database used with DirectQuery. If this property is <code>false</code>, those columns are not taken from the database.</td></tr></tbody></table>

For a Sign-Off deployment, the Adjustments and Sign-Off hierarchies are present in the Cube configuration.
Therefore, those hierarchies must also be present in the Cube’s definition on the DirectQuery data node to make horizontal distribution possible.
To achieve this, in the Cubes using DirectQuery, a “dummy” Sign-Off hierarchy and a regular
Adjustments hierarchy are created, using the values in the DirectQuery database for the Source and Input Type levels of the hierarchy.

## Option 2: Adjustment fields are present

In this case, the DirectQuery database is used with additional fields in the tables where adjustments can be present.
You have to add the following fields:

* `SOURCE`: Sign-Off adjustment source tagging (for example, user input)
* `INPUT_TYPE`: type of the adjustment entry (for example, reversal)

In the tables in which adjustments can be present, you must add these fields **and include them in the list of fields defining the primary keys**:

<table><thead><tr><th>Column Name</th><th>Type</th><th>Not Null</th><th>Default Value</th><th>Description</th></tr></thead><tbody><tr><td><code>SOURCE</code></td><td>STRING</td><td>Y</td><td>‘Unadjusted’</td><td>Sign-Off adjustment source tagging (for example, user input)</td></tr><tr><td><code>INPUT\_TYPE</code></td><td>STRING</td><td>Y</td><td>‘Data load’</td><td>Sign-Off adjustment source tagging (for example, reversal)</td></tr></tbody></table>

By default, the you need to add the fields to the following tables:

* `TRADEPNLS`
* `TRADEPNLS_VECTOR`
* `TRADE_SENSITIVITIES`
* `TRADE_SENSITIVITIES_VECTOR`
* `PNL`

You also need to add the fields to any custom table in your project for which adjustments are supported.

In this setup, to enable horizontal distribution on the data node, use the following configuration for the DirectQuery data node, in addition to the settings already defined:

<table><thead><tr><th>Property</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><code>configuration.sign-off.enable</code></td><td>true</td><td>Flag used to enable Sign-Off-related features.</td></tr><tr><td><code>directquery.with-adjustments</code></td><td>true</td><td>This property is only taken into account if the property <code>configuration.sign-off.enable</code> is <code>true</code>. Specify if columns handling adjustments (<code>SOURCE</code> and <code>INPUT\_TYPE</code>) are present in the database used with DirectQuery. If this property is <code>true</code>, these columns are taken from the database.</td></tr></tbody></table>
