> For the complete documentation index, see [llms.txt](https://docs.finngen.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/concept-sets/exclude-and-remove-codes-from-concept-set.md).

# Exclude and Remove codes from Concept Set

{% hint style="info" %}
This page is a continuation of [Create concept set using standard-code descendants](/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/concept-sets/selecting-descendants-for-a-concept-set-in-atlas.md) tutorial.
{% endhint %}

Once you have created a Concept Set, you can exclude or remove codes using the **Concept Set expression** page or the **Included Concepts** page.

### Exclude codes

The following example shows how to exclude codes using the **Included Concepts** page.

* Select the **Id** column check box on the left for every code you wish to exclude. In the example below we have clicked all shown codes.
* Scroll down the page, select the **Exclude** check box and click the **Add to Concept Set** Button.

<figure><img src="/files/3sg4scvUTrp05jrZ54kR" alt=""><figcaption></figcaption></figure>

* You can see the excluded codes on the **Concept Set Expression** page; they have their **Exclude** column checkbox selected. In the example below, the number of concepts shown in the **Included Concepts** tab was reduced to 96.

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

### Remove codes

The following example shows how to remove codes using the **Concept Set Expression** page.

* Select the **Id** column check box on the left for every code you wish to remove. In the example below we have clicked all shown codes except for Asthma and Allergic asthma.

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

* Scroll down the page, and click the **Remove Selected** Button.

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

{% hint style="info" %}
If you remove excluded standard code descendants, then these codes will become part of the Concept Set again.
{% endhint %}


---

# 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 current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/concept-sets/exclude-and-remove-codes-from-concept-set.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
