# 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>


---

# Agent Instructions: 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 current page URL with the `ask` query parameter:

```
GET https://academy.dnanexus.com/cohortbrowser/how-to-create-cohorts/cohort-combine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
