> For the complete documentation index, see [llms.txt](https://kb.bravegen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.bravegen.com/carbon/core-concepts/data-collection/tasks/resolving-collisions.md).

# Resolving Collisions

Learn how BraveGen Carbon detects and resolves overlapping task data within a process.

A collision is determined when data from one task would overlap (collide) with data from another task or from itself for the same [source](/carbon/core-concepts/activity-sources.md) and period. (e.g. accidentally sending the same file twice, or loading a 'correction' data set).

{% hint style="warning" %}
Data is **not** considered 'in collision' if it comes from **different processes.**

The system automatically resolves this by including both datasets.
{% endhint %}

{% hint style="warning" %}
Data is **not** considered 'in collision' if it comes from multiple files on the **same task**.

The system automatically resolves this by including both datasets.
{% endhint %}

The system resolves collisions based on the 'on data collision' and quarantine behaviour set on the process

<figure><img src="https://56003612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5LvYBvfJ43u2Q5Y715DI%2Fuploads%2FEBHzeCCv3QHBi9K7hyKh%2Fimage.png?alt=media&amp;token=1edc82f2-7800-4d71-ba5e-b3a17964996e" alt=""><figcaption><p>Setting 'On Data Collision' when creating a process</p></figcaption></figure>

<figure><img src="https://56003612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5LvYBvfJ43u2Q5Y715DI%2Fuploads%2FatYoCiiGzpnyEqy5hoSy%2Fimage.png?alt=media&amp;token=f3f61e2d-afd6-4b47-836c-0612e8938d27" alt=""><figcaption><p>The collision behaviour displayed on a process detail</p></figcaption></figure>

## 'On Data Collision' Setting

Determines the default behaviour to suggest or apply if a collision is detected

<details>

<summary><strong>Append to Existing Data</strong></summary>

Incoming data is added to the existing data for the period

</details>

<details>

<summary><strong>Overwrite Existing Data</strong></summary>

Incoming data replaces existing data for the period

</details>

<details>

<summary><strong>Keep Existing Data</strong></summary>

Incoming data is ignored, preserving existing data for the period

</details>

## Collision Resolution

Whether a collision is manually or automatically resolved depends on the task [quarantine setting](/carbon/core-concepts/data-collection/tasks/quarantine.md#task-quarantine-options) (as set on the parent [process](/carbon/core-concepts/data-collection/processes.md)).

{% hint style="info" %}
If the data has a 'from' and 'to' date, partial collisions are resolved using a pro-rated daily value.&#x20;

Eg:&#x20;

* Existing: **1 Jan–31 Jan, 310 kWh (10kWh/day)**
* Incoming: **15 Jan–15 Feb, 320 kWh  (10.322..kWh/day)**

Existing data in collision = **15 Jan-31 Jan,** **160kWh**&#x20;

Incoming data in collision = **15 Jan-31 Jan, 165.15kWh**&#x20;
{% endhint %}

#### Quarantine = Never

Both tasks are marked complete, colliding data is automatically resolved according to the ['On Data Collision'](#on-data-collision-setting) setting (Append, Overwrite, Keep)

#### Quarantine = Collisions Only

The first task is automatically accepted, the second task is quarantined as it is determined to be in collision with the data from the first task. Collisions must be manually resolved, colliding items resolution is preset to ['On Data Collision'](#on-data-collision-setting) setting Append, Overwrite, Keep)

#### Quarantine = Always

Both tasks are quarantined upon data arrival. When a task is marked complete, all quarantined tasks are refreshed to check for potential collisions, flagging the second task as 'in collision'. Collisions view shows items preset to ['On Data Collision'](#on-data-collision-setting) setting (Append, Overwrite, Keep)

#### Quarantine = Outside Treshold (coming soon)

Behaves like Quarantine Collisions Only

### Manually Resolving Collisions

If a task is quarantined for collision resolution the 'Collisions' tab will be accessible on the task, prompting the user to resolve the collision before the task can be approved.

This view displays a table with a split row for each source collision. The existing and new data is labeled, and a dropdown for the user to specify the resolution (Append, Overwrite, Keep).&#x20;

Users can resolve these one by one, by clicking the green 'check' button on the end of each row, or bulk resolve all by clicking the 'circled check' button in the table header.

Once all collisions are resolved, the task can be approved, and processed into emissions data.

<figure><img src="https://56003612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5LvYBvfJ43u2Q5Y715DI%2Fuploads%2F00th0yGPdPR2L2wukiZH%2Fimage.png?alt=media&amp;token=fbf9a94c-3d8b-459c-bf4e-51b5fb8b97fd" alt=""><figcaption><p>The collisions resolution view, showing a bulk action bar when multiple collisions are selected</p></figcaption></figure>
