# Filtering While Retaining Missing Values

**URL:** <https://community.exploratory.io/t/filtering-while-retaining-missing-values/4104>\
**Category:** Uncategorized\
**Created:** [November 25, 2025, 5:10am UTC](https://community.exploratory.io/t/filtering-while-retaining-missing-values/4104 "2025-11-25T05:10:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Takato\_Shiroto](https://community.exploratory.io/user_avatar/community.exploratory.io/takato_shiroto/32/749_2.png) [@Takato\_Shiroto](https://community.exploratory.io/u/Takato_Shiroto)\
**Post date:** [November 25, 2025, 5:10am UTC](https://community.exploratory.io/t/filtering-while-retaining-missing-values/4104/1 "2025-11-25T05:10:52Z")

</div>

For example, suppose you use a filter to narrow down data targeting a column that contains missing values.

 ![image](https://community.exploratory.io/uploads/default/original/2X/c/cfe3992f4061de98f28043a62fd9d0043302d795.jpeg)

In this case, the filter normally works after excluding missing values.

 ![image](https://community.exploratory.io/uploads/default/original/2X/7/7896c19feeddf850e99fa701de0e584cdeb4938a.jpeg)

Here, we’ll introduce a method to filter while keeping missing values.

By setting conditions in the filter dialog, a conditional expression will be displayed at the bottom of the dialog, so copy this.

 ![image](https://community.exploratory.io/uploads/default/original/2X/4/4ab1ae9f807e6709906778065487066e5f33f19a.jpeg)

Next, select “Custom” and enter the following formula:

```auto
is.na(Segment) | Segment %in% c("Consumer", "Corporate")

```

 ![image](https://community.exploratory.io/uploads/default/original/2X/f/fc3de4eab8bb31f76258bebf1864b98461b3ae1d.png)

The is.na function determines whether a value is missing. Also, “|” represents an OR condition, so it will narrow down to values where either the value is missing or the Customer Segment is Consumer or Corporate.

By executing this, you can filter while retaining missing values.

 ![image](https://community.exploratory.io/uploads/default/original/2X/9/95f3fc1982d3978ab67faeb14b7478a7de87b26d.jpeg)
