# Dataset selectors Every dataset selector can be configured to either `Select` or `Exclude` the datasets that match the criteria in the selector. For example, `Select` derived datasets will narrow the funnel to include ONLY derived datasets. `Exclude` datasets in folder `/palantir/finance` will narrow the funnel by not including datasets in the given folder. Some dataset selectors also include a second argument, for example the list of folders or worker types to include or exclude from the policy. The following list describes the dataset selectors available for use when configuring retention policies in the Retention application. ## In the following datasets Selects all datasets by their given RIDs, which will not change even if you rename the dataset. [Learn more about identifying a dataset's RID.](../../analytics-connectivity/identify-dataset-rid/index.md) **Takes 1 argument:** `list of datasets` (a list of datasets saved by their RIDs). ### Example `Select` the following datasets: `` ![In dataset list](../../../assets/777efb309b1254f9f2f2f46703ae73cc039b60ca9962f326e280b4166a202e5b.webp) ## Datasets in the following folders Selects all datasets in the given folders or Projects identified by their given RID. Any future dataset created in these folders or Projects will also be subject to this policy. **Takes 1 argument:** `list of folders` (a list of folders or Projects saved by their RIDs). ### Example `Select` datasets in the following folders: `` ![Datasets in the following folders](../../../assets/b615100ae420381c5ac2dce8f3d821c9700372271d2f5fb9a402299725124d87.webp) ## Is derived dataset A dataset is defined to be a derived dataset if, and only if, the following conditions are true: * The dataset contains a [JobSpec](../../data-integration/builds/index.md#jobs-and-jobspecs) in its master branch. * The dataset has a non-zero number of dataset inputs. Datasets that do not meet these conditions, including raw datasets, datasets ingested from an external source, and datasets that were never built on a master branch, will not be selected by this selector. **Takes an optional `worker type` list as argument:** The `worker type` list is a set of worker types that are specified in the `workerType` field in the JobSpec (for example, `transforms` and `phonograph2-writeback` in the image below). If this field is left empty, this selector will affect ALL derived datasets. ### Example `Select` derived datasets with the following worker types: `transforms`, `phonograph2-writeback` ![Is derived dataset](../../../assets/d080627fa8efc4a5cf06be4ad214c83cec01fc719d7fabc101f6c20ebded7b47.webp) ## Is transforms dataset The **transforms datasets with transform type** selector identifies datasets built by transforms. Unlike **[Is derived dataset](#is-derived-dataset)**, this selector filters by transform type rather than worker type. **Takes an optional `transform type` list as argument:** A dataset matches when its transform type or transform alias matches one of the specified values. If you leave the list empty, this selector matches all transforms datasets. ### Example Choose **transforms datasets with transform type** in **Select** mode and set the transform type to `projection` to target [projection datasets](../../optimizing-pipelines/projections-advanced/index.md#projection-datasets). ![An example shows the transforms datasets selector.](../../../assets/f8f3577a5270e9254b6122d6dc34d1cd3a64fe0ccd55e28f9e2810da82e37bfa.webp) ## Is in trash Select datasets that are in the trash. **Takes no arguments.** ### Example `Select` datasets in the Trash ![Is in trash](../../../assets/24f06d99f6b81b5239cea20d453369f15d3102c919e2aa21c67aa848e05c04d6.webp) ## Example of combined selectors To demonstrate the dataset selectors and how they can work in combination, consider the following two examples: ### Apply a broad policy with exemptions in a specific folder The following collection of dataset selectors will select all untrashed datasets in the [space](../../security/orgs-and-spaces/index.md#spaces) which are not contained in `folderA`: * `Select` all datasets in the space * `Exclude` datasets in the Trash * `Exclude` datasets in the following folders: `folderA` ![Example 1](../../../assets/1220e8a26e49a5022002af5e66ebe9335157e8e42f271b3b0ebeba801a067fdc.webp) ### Select all datasets in a project except one The following collection of dataset selectors will select all datasets in `folderA` except for `Incremental dataset`: * `Exclude` the following datasets: `Incremental Dataset` * `Select` datasets in the following folders: `folderA` ![Example 2](../../../assets/fa0d822b6a694a5d7aec90b2cd5997405168d1290241b2ac762efcc2f95ba5c9.webp) ## Protecting datasets from retention You can protect specific datasets from **a given retention policy** by using the **Exclude** mode with the [**In the following datasets**](#in-the-following-datasets) selector. This excludes individual datasets from that policy by their RIDs. This exclusion applies only to the policy you are configuring. Other retention policies operating in the same [space](../../security/orgs-and-spaces/index.md#spaces) — including recommended (platform-managed) policies and any other custom policies — may still mark transactions on the excluded datasets. To fully protect a dataset, review every policy that could apply to it. ## Deprecated selectors ### In compass name We recommend using the [`Datasets in the following folders`](#datasets-in-the-following-folders) selector instead. ### In dataset paths We recommend using the [`In the following datasets`](#in-the-following-datasets) selector instead.