> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/setup/document-training/training-line-fields-table-training/advanced-settings.md).

# Advanced Settings

In some documents, table structures can be complex—spanning multiple lines, containing grouped information, or including unnecessary extra rows. The *Advanced Settings* in training mode allow you to fine-tune table extraction for such cases, improving accuracy and consistency.

To access these settings, activate **Training Mode** and click the **Settings** gear icon in the top action bar:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-d40b6e6916dc0a831c4b4cde22b2c81ea5097265%2Fa-training-line-fields-table-training-advanced-settings-gear-en-20261006.png?alt=media" alt="Table extraction screen in training mode with the mouse over the Settings gear icon in the top action bar."><figcaption><p>The Settings gear in the training mode action bar opens the Advanced Settings.</p></figcaption></figure>

### Header Row Count

**Use this setting to define how many lines make up the table header.**

Some tables have multi-line headers. For example, this table’s header spans two lines:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-3e6ed812b9668ca0ab62fbae53138b1fa2f4ef61%2Fa-training-line-fields-table-training-advanced-settings-header-two-lines-en-20261006.png?alt=media" alt="Invoice table whose header spans two lines (Preis / in EUR and Betrag / in EUR)."><figcaption><p>A table header that spans two lines.</p></figcaption></figure>

Set the **Header row count** to match:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-32187efc0b2e5361cf3c800f63be76af2ac1a1cd%2Fa-training-line-fields-table-training-advanced-settings-header-row-count-en-20261006.png?alt=media" alt="Settings dialog with Header row count set to 2."><figcaption><p>Header row count set to 2 in the Settings dialog.</p></figcaption></figure>

#### Why is this important?

If you don’t set this, DocBits may treat the second line as data instead of part of the header, leading to extraction errors:

**Before:**

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-7a225512d76c40b831e8f6568826a2d3c5df8435%2Fa-training-line-fields-table-training-advanced-settings-header-before-en-20261006.png?alt=media" alt="Extracted table with a wrong header row count: the second header line appears as a data row and the column headers are not mapped."><figcaption><p>Before: the second header line is treated as data.</p></figcaption></figure>

After:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-553f4e55f08395446a00bf8e5c3bfc4c11f0a2c0%2Fa-training-line-fields-table-training-advanced-settings-header-after-en-20261006.png?alt=media" alt="Extracted table with Header row count 2: columns are mapped to Position, Description, Quantity, Unit Price and Net Amount and the rows are correct."><figcaption><p>After: header and data rows are separated correctly.</p></figcaption></figure>

### Move Extra Rows to Trash

**Use this to discard unwanted multi-line entries, such as overflow descriptions.**

In this example, the description spills into multiple rows, but only the first line is relevant:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-55e0e078a1b8254cf5a811303f74d46279782c11%2Fa-training-line-fields-table-training-advanced-settings-overflow-doc-en-20261006.png?alt=media" alt="Invoice table where the description of each item continues on additional text lines below the item."><figcaption><p>The description spills into several lines of which only the first is relevant.</p></figcaption></figure>

Enable **Move Extra Rows to Trash** to remove the overflow:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-d65b0e746e4ecd3df53dc0753f7520a3a2d14fe1%2Fa-training-line-fields-table-training-advanced-settings-move-extra-rows-en-20261006.png?alt=media" alt="Settings dialog with Move Extra Rows to set to Trash."><figcaption><p>Move Extra Rows to Trash enabled.</p></figcaption></figure>

**Result after mapping:**

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-553f4e55f08395446a00bf8e5c3bfc4c11f0a2c0%2Fa-training-line-fields-table-training-advanced-settings-header-after-en-20261006.png?alt=media" alt="Extracted table with three clean rows after the extra description lines were moved to trash and the columns were mapped."><figcaption><p>Result after mapping: only the relevant rows remain.</p></figcaption></figure>

### Minimum Grouped Rows

**Use this when rows need to be grouped together under one main row (e.g. line items with multiple sub-lines).**

Here, only three out of six rows are relevant. Two key columns are mapped (e.g. Position, Description), while others are treated as custom fields.

Start by setting **Header row count** and the **Minimum grouped rows**:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-cab5d6e44f40755279fba049e20d88bbd620a87f%2Fa-training-line-fields-table-training-advanced-settings-min-grouped-en-20261006.png?alt=media" alt="Settings dialog with Header row count 2 and the Advanced Settings section expanded showing Minimum grouped rows set to 2."><figcaption><p>Header row count and Minimum grouped rows set in the Settings dialog.</p></figcaption></figure>

Also enable **Move Extra Rows to Trash** to clean up irrelevant data:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-119301fbf9d12b2493b8a0fb70f8c7e3da4ba523%2Fa-training-line-fields-table-training-advanced-settings-min-grouped-trash-en-20261006.png?alt=media" alt="Settings dialog with Header row count 2, Move Extra Rows to Trash and Minimum grouped rows 2."><figcaption><p>Move Extra Rows to Trash enabled in addition.</p></figcaption></figure>

Then define the grouping key column, e.g. *Position*:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-52aa8b4dffb2bcf959a486856676d9b273dd981f%2Fa-training-line-fields-table-training-advanced-settings-group-key-en-20261006.png?alt=media" alt="Extracted table with the column menu of the Position column open showing Delete column, Group rows and Regex."><figcaption><p>Choose Group rows in the column menu of the grouping key column (Position).</p></figcaption></figure>

**Result:**

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-553f4e55f08395446a00bf8e5c3bfc4c11f0a2c0%2Fa-training-line-fields-table-training-advanced-settings-header-after-en-20261006.png?alt=media" alt="Extracted table with three grouped rows after grouping by Position and trashing extra rows."><figcaption><p>Result: the six physical rows are grouped into three line items.</p></figcaption></figure>

### Reverse Grouping

**Use this when the grouping row appears&#x20;*****after*****&#x20;the rows it should group.**

If the row that should be grouped with other data appears *above* the grouping key, enable this option:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-2611e3e8729ab2d1999e81adcb63055317279bc3%2Fa-training-line-fields-table-training-advanced-settings-reverse-doc-en-20261006.png?alt=media" alt="Invoice table in which the description line stands above the line that carries position, quantity and amounts."><figcaption><p>The grouping row appears after the rows it should group.</p></figcaption></figure>

Enable **Reverse grouping**, group by a main column (e.g. Net amount), and use **Move Extra Rows to Trash** if needed:

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-1d567ac2be13a132fc2b0368890564d73426219d%2Fa-training-line-fields-table-training-advanced-settings-reverse-dialog-en-20261006.png?alt=media" alt="Settings dialog with Reverse grouping checked, Move Extra Rows to Trash and Header row count 2."><figcaption><p>Reverse grouping enabled together with Move Extra Rows to Trash.</p></figcaption></figure>

**Final result:**\\

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-95e6018c656582358ba1ea05e230c97ace018a95%2Fa-training-line-fields-table-training-advanced-settings-reverse-result-en-20261006.png?alt=media" alt="Extracted table with three rows after reverse grouping by the amount column."><figcaption><p>Final result with reverse grouping.</p></figcaption></figure>

### Summary

Use the *Advanced Settings* to teach DocBits how to accurately handle more complex or inconsistent table structures. These settings improve extraction precision by accounting for:

* Multi-line headers
* Multi-row descriptions
* Grouped line items
* Reverse order of grouped data

Enabling these options during training ensures DocBits remembers the correct layout for future documents from the same supplier.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/administration-and-setup/setup/document-training/training-line-fields-table-training/advanced-settings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
