> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filter Category

> Filter a dataset based on a single categorical column, keeping only the selected values

## Description

This function allows to filter a dataset based on a single categorical column. The function is a positive filter; all selected values will be kept in the dataset.

<Note>
  Please note that this function can **ONLY** be used with datasets that **DO NOT** contain missing data - You may need to clean your data using the 'Remove Missing' function, or alternatively, fill in any missing data before uploading data to the platform
</Note>

***

## Application

Filter Categorical can help to reduce the size of the data and focus on relevant information. For example, focus on one type of test or one type of material. It can also be used to do a manual train-test split if you have only a small number of time series.

***

## How to use

* Create the step and assign a tabular dataset to it in the field **Data**.
* Select a **Column** on which to apply the filter.
* The field **Value(s)** is defining the filter. The value(s) selected here will be kept in the dataset, all other values will be removed.
  * If you want to select more than one value, enable the option Allow multiple values.

<img src="https://mintcdn.com/coreweave-dbfa0e8d/QRLrBgwZtalbZXz3/monolith-ai/_media/Filter-Category-1.png?fit=max&auto=format&n=QRLrBgwZtalbZXz3&q=85&s=2ea74652fcd5b9ea2b7555933e785884" alt="Filter Category step configuration with fields for Data, Column, and the Values to keep" width="640" height="400" data-path="monolith-ai/_media/Filter-Category-1.png" />

* You can make the step **Interactive**.
  * If this option is left blank the step can only be changed by re-entering the edit mode and change the options (especially the field Value(s)).

<img src="https://mintcdn.com/coreweave-dbfa0e8d/QRLrBgwZtalbZXz3/monolith-ai/_media/Filter-Category-2.png?fit=max&auto=format&n=QRLrBgwZtalbZXz3&q=85&s=348d2c435ed1f2e62dcfddc5439e0f0e" alt="Filter Category step showing the filter summary and the message Filtered from 9612 to 3690 rows" width="1644" height="306" data-path="monolith-ai/_media/Filter-Category-2.png" />

* If this options is enabled the Value(s) field is exposed in the notebook and can be changed interactively without starting the edit mode.

<img src="https://mintcdn.com/coreweave-dbfa0e8d/QRLrBgwZtalbZXz3/monolith-ai/_media/Filter-Category-3.png?fit=max&auto=format&n=QRLrBgwZtalbZXz3&q=85&s=c0cccbe7f5ff2fedc1e5147d74f24e56" alt="Interactive Filter Category step with the Values field exposed in the notebook showing two selected values" width="1636" height="450" data-path="monolith-ai/_media/Filter-Category-3.png" />

* You can save the resulting dataset under a new name. Enable **Save output under different name** to do so. If that option is unticked the existing dataset will be overwritten.
* Click **Apply** to filter the data.

At the bottom of the step an info message will be shown which displays the number of rows before and after applying the filter ("Filtered from X to Y rows", see screenshots above).

***

## More on this step

* If your filter step is **Interactive** and you **Allow multiple values** it is possible to deselect all entries in the **Values** field. This will result in an error of that step. Enter edit mode to select **Values** and rerun filter.
* If a Filter Categorical step is exposed on a dashboard, users can only change the filter if it is made **Interactive**.
