> For the complete documentation index, see [llms.txt](https://docs.dataloy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dataloy.com/release-8.31/voyage-management-system/step-by-step-guides/voyages/maintain-voyages/voyage-analysis/deviation-calculation.md).

# Deviation Calculation

This page provides a detailed explanation of a Voyage Function - Deviation calculation.

The deviation calculation function offers a comprehensive analysis of the difference between the current voyage and the same voyage as if it were direct — from the ballast port to the last port call.

This function is particularly useful when freight rates are low, voyages must adhere to strict schedules, or deviations are required for compliance. It helps determine whether an additional detour can generate enough extra revenue to offset the added distance, time, emissions, and fuel costs.

<figure><img src="https://content.gitbook.com/content/zjy4yJFZRJooU1EGrLs5/blobs/kl6hXiOkDcprvqqAoxpi/image.png" alt=""><figcaption><p>Figure 1. Deviation Calculation modal.</p></figcaption></figure>

Figure 1 shows the Deviation Calculation window, comparing the current voyage results (in the Loaded column) with a hypothetical direct voyage (in the Direct column). The Variance column highlights the differences between the two. By clicking Open Direct Voyage, users can review the direct route’s details (Figure 2). In this example, the detour with cargo generates higher revenue, making it a more favourable option.

#### Prerequisites:

* The Deviation Calculation function is available only for **Estimate Voyages**.

<figure><img src="https://content.gitbook.com/content/zjy4yJFZRJooU1EGrLs5/blobs/ph0BtpdF4jODdMF3l9lU/image.png" alt=""><figcaption><p>Figure 2. Direct Voyage from the Deviation modal.</p></figcaption></figure>


---

# 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 dynamically by asking a question.

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

```
GET https://docs.dataloy.com/release-8.31/voyage-management-system/step-by-step-guides/voyages/maintain-voyages/voyage-analysis/deviation-calculation.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 `build a script that syncs our docs to a CMS` 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.
