> For the complete documentation index, see [llms.txt](https://academy.dnanexus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.dnanexus.com/cohortbrowser/how-to-create-cohorts/cohort-combine.md).

# Cohort Combine

*Please note: in order to use Cohort Browser on the Platform, an Apollo License is needed.*

## Cohort Combine Logic

Cohort combine logic allows you to combine existing cohorts with Boolean Logic operations

### **Overview**

Here is a summary of the functions for Cohort Combine

<figure><img src="/files/pRpwZBNGCHDxnCKFfeBr" alt=""><figcaption></figcaption></figure>

## **Rules and Boundaries**

* All cohorts must be from the same dataset.
* All cohorts must be saved before being combined.
* A cohort that is a result of combine cannot be combined a second time.
* Cohorts from different projects can be combined if they use the same underlying database.
* Cohort combine are very complex queries
* Beware of performance delays and timeouts as query gets more complex.
* Use extra caution when:
* Combining cohorts with genomic filters
* Combining cohorts with complicated filters
* Combining cohorts based on very large datasets

## **How To:**

1. Add your cohorts into the cohort browser by selecting “Load Saved Cohort” if the cohort has already been created and saved into the project, or “New Cohort” if a new cohort needs to be created. You can select up to 10 cohorts to load into the side menu.&#x20;

<figure><img src="/files/1YmEMqpKDlB6012zQn0f" alt=""><figcaption></figcaption></figure>

2. Pick your cohort and add it to the browser. It will look like this.

<figure><img src="/files/tEczD3sMvTJocgG0G9o8" alt=""><figcaption></figcaption></figure>

3. At the bottom of the cohort tab, select "Combine Cohorts"

<figure><img src="/files/LmEhCjz578EPVLYmrqwE" alt=""><figcaption></figcaption></figure>

4. You will then have the following screen to combine. Pick your cohort combine logic, then select combine

<figure><img src="/files/KbXnUkn7KKHygth0tc4R" alt=""><figcaption></figcaption></figure>

## Examples of Cohort Combine Functions&#x20;

### Intersection

#### **Overview:**

<figure><img src="/files/aPLaJ8xv4cSZG0GFmO7U" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="/files/KkMPcg9KrfLbkmimjRGH" alt=""><figcaption></figcaption></figure>

### Union

#### **Overview:**

<figure><img src="/files/s1ekEIjVizEYIM8Tlyt5" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="/files/JlthsBIHtG2QyD3Hgd73" alt=""><figcaption></figcaption></figure>

### Subtraction

Important note: the order of the cohorts matters in this.

#### **Overview:**

<figure><img src="/files/jdsvq1NI7Kd6j6ZsaS39" alt=""><figcaption></figcaption></figure>

#### **Example 1:**

<figure><img src="/files/yUQlJDh10zyvxIXsnaIf" alt=""><figcaption></figcaption></figure>

#### **Example 2:**

<figure><img src="/files/H7PpYcO2ygOI6h7mmTSf" alt=""><figcaption></figcaption></figure>

### Unique

#### **Overview:**

<figure><img src="/files/zAsl5lPwlsMrkn4kfStn" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="/files/lTDH2hjjaydhSZi5doV3" alt=""><figcaption></figcaption></figure>

### Complement

Important notes:

* Cohort must be saved before creating its complement (same rule as previous)
* A combined cohort (Intersection, Union, Subtraction, Unique) can be used to create a complement.
* A cohort created as a complement cannot be further used for combine / complement.

#### **Overview:**

<figure><img src="/files/snW5rWoODFcxyw21xMJv" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="/files/b3uhaQrqNszbcfgAeqoe" alt=""><figcaption></figcaption></figure>
