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

# Sample 4. Step 9.1: Total Amount name, kwTotal element

> Spot the Total Amount field name with a SumGroup.kwTotal Static Text element limited to the last page and scored by its distance from the table bottom.

This field name occurs on the images as `Total Chf`, `Carried Over`, or `Total`. It is located below the table (this constraint is already specified for the **SumGroup** element) and always occurs on the last page.

## Create the kwTotal element

<Steps>
  <Step title="Create the Static Text element">
    In the **SumGroup** element, create a [Static Text](/flexi-capture/fls/template/static-text) element and name it **kwTotal**.
  </Step>

  <Step title="Enter the search text">
    Click the **Static Text** tab. In the **Search text** field, type `TotalChf|CarriedOver|Total`.
  </Step>

  <Step title="Set the maximum error percentage">
    Set **Max error percentage** to 20.
  </Step>

  <Step title="Limit the search to the last page">
    Click the **Search Constraints** tab and limit the search area to the last page:

    * Select **Absolute search area constraints**.
    * In the **Pages** field, select **Last** from the drop-down list.
    * Do not select any other options.
    * Click **Add**. The search area appears in the **Search areas** list.

    <Frame>
      <img src="https://mintcdn.com/abbyy/8aWHPAJyzWmTqglX/images/flexi-capture/fls/tutorial4_9_1.png?fit=max&auto=format&n=8aWHPAJyzWmTqglX&q=85&s=93900e6f673ca7c0e04b62ca2f0efccc" alt="Screenshot of the Search Constraints tab of the SumGroup.kwTotal Static Text element properties in ABBYY FlexiLayout Studio, showing absolute search area constraints limiting the search to the last page added to the search areas list." width="427" height="454" data-path="images/flexi-capture/fls/tutorial4_9_1.png" />
    </Frame>
  </Step>

  <Step title="Add post-search relations">
    Among the many detected elements that contain the specified text, select the one closest to the bottom boundary of the table. This location lets you influence the quality of the hypotheses. Click the **Advanced** tab. In **Advanced post-search relations**, specify additional parameters for the hypothesis: if a non-null hypothesis is generated, calculate the distance between the upper boundary of the detected element and the bottom boundary of the last table detected in the document, and check whether this distance belongs to the specified fuzzy interval. In the [FlexiLayout language](/flexi-capture/fls/code/general-code):

    ```text theme={null}
    If not IsNull then
    { FuzzyQuality: Top - InvoiceTable.LastSubTable.Body.Rect.Bottom, {0,0,0, 50000}*dt;
    }
    //This check means that the greater the distance between the boundaries, the greater the penalty coefficient
    ```
  </Step>
</Steps>
