# 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="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FVDCRdj7lsGgzaaUpBrRF%2Funknown.jpeg?alt=media&#x26;token=782774b5-8ad0-4c2f-b1e0-c8c3abf8d7e7" 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="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FEiAULgZIZBdcTINTCq8B%2Funknown.png?alt=media&#x26;token=5eae7f74-402a-4cec-9efe-225ee1072813" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FzWQQdcAxoDjCIA050bvh%2Funknown.png?alt=media&#x26;token=5c810505-feee-44d4-b1c2-a4864af30b31" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2Fv1kYznyKYQ0C0hw9JMn9%2Funknown.png?alt=media&#x26;token=a9a5e3b4-9b5a-4881-b624-631d6dcbde77" 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="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FFEQ0OBL9Knzw9kBj5pas%2Funknown.png?alt=media&#x26;token=0c1f62a8-c6be-47c1-8026-6433a0544198" alt=""><figcaption></figcaption></figure>

## Examples of Cohort Combine Functions&#x20;

### Intersection

#### **Overview:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FdN6M7fiYKd3BzXLRhN5f%2Funknown.jpeg?alt=media&#x26;token=e73560e4-a313-41f4-9da1-8c74becef1c3" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FBoybd55FQGf1isSPn6S9%2Funknown.jpeg?alt=media&#x26;token=edca8b61-7dc9-49ab-a0b4-8a2d6bfd8561" alt=""><figcaption></figcaption></figure>

### Union

#### **Overview:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2F0l0m6nZF9a3otB1xNI7V%2Funknown.jpeg?alt=media&#x26;token=96f0eef9-97f9-4733-bd82-f1c8eb09fdf0" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2F28jvxlBOHWtM0TgDE1jJ%2Funknown.jpeg?alt=media&#x26;token=4ec948c5-7cb5-41b1-87f5-8208207a4c45" alt=""><figcaption></figcaption></figure>

### Subtraction

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

#### **Overview:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2F5ad88hNA7jkxbDlfCo12%2Funknown.jpeg?alt=media&#x26;token=2795a19d-ab05-4b33-ad57-b764d0ac5364" alt=""><figcaption></figcaption></figure>

#### **Example 1:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FFbGAPyvFcOdSclvfVMNs%2Funknown.jpeg?alt=media&#x26;token=caff7706-7866-4f0f-868b-b49809944806" alt=""><figcaption></figcaption></figure>

#### **Example 2:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FF9nhfFXWSjsRDGY3lqhJ%2Funknown.jpeg?alt=media&#x26;token=d6044716-73d4-4397-991b-3b0051bb3d1c" alt=""><figcaption></figcaption></figure>

### Unique

#### **Overview:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2F2fwuMXn4PUkdIC2VhTNv%2Funknown.jpeg?alt=media&#x26;token=e8df2234-9846-4205-87d1-8cdd25515336" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FGIgUijLXTR7BAFyqTlYx%2Funknown.jpeg?alt=media&#x26;token=765c00c9-c4f6-4dc7-b37a-c8097832492b" 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="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FPXzaTaYVH0R9OInRlxdi%2Funknown.jpeg?alt=media&#x26;token=ee2de0ea-9305-49fb-b1e0-183399c87804" alt=""><figcaption></figcaption></figure>

#### **Example:**

<figure><img src="https://1979569080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPtCOm9rXoRi4P9rh1ET8%2Fuploads%2FKHkwQEzCcL76bEY8P3Jf%2Funknown.jpeg?alt=media&#x26;token=606903bf-1daa-4e0b-86eb-f06f300ba172" alt=""><figcaption></figcaption></figure>
