---
title: "Fill missing values with Impute in Strata | Oplema"
description: "Fill missing values with the mean, median, mode or a fixed value using Impute in Strata. You can keep the original column and flag each filled cell."
url: "https://oplema.com/docs/strata/prep/impute"
updated: "2026-11-04"
---

# Impute

Fill missing values with a fixed value or a statistic such as the column mean. Incomplete rows stay in your table. You can also keep the original values and flag the cells chosen for replacement.

**Learn this in context:** [More data tools: when you'd use each one](https://oplema.com/learn/table-to-dashboard/more-data-tools) (Build and publish a dashboard)

## Fill a missing value

Manual Input has one value column containing 10, 20, 30 and NULL. Impute starts with Replace What set to Null and replaces the missing value with 0.

Result
| value |
| --- |
| 10 |
| 20 |
| 30 |
| 0 |

1. Change Replace With from `Value` to `Mean` for the `value` column. The missing value becomes 20, the mean of 10, 20 and 30.
2. Select Separate Columns. The original `value` column keeps its NULL, while `value_imputed` contains the filled result.
3. Select Add Flag. `value_imputed_flag` is true for the row that was missing and false for the other three.

## When to use

Use Impute when rows with missing values should stay in the table and a fixed value or an average is a fair replacement. To fill gaps from neighboring rows in ordered data, use Interpolation.

## Read the output

The initial output contains `10`, `20`, `30` and `0`. Only the missing value changes. Switch to Mean and it becomes `20` instead. All four rows stay.

With **Separate Columns**, `value` keeps the original values and `value_imputed` has the results. **Add Flag** marks the row that was missing, so you can still find it after it's filled.

Every replacement is an assumption about the missing data. Use a fixed value only when that default makes sense, and Mean when the column average is a fair stand-in.

To fill gaps using neighboring rows in an ordered sequence, use [Interpolation](https://oplema.com/docs/strata/prep/interpolation).

To separate incomplete rows for inspection, use [Filter](https://oplema.com/docs/strata/prep/filter).

## Inputs and outputs

### Inputs

1 port

**In Required**

Accepts: Tables, Geospatial data.

Accepts one connection on this port.

### Outputs

1 port

**Out**

## Configure the block

Choose a replacement method for each column and which cells it replaces. If a chosen column isn't in the input, it's skipped with a warning and its settings are kept.

**Replace With**

None leaves a column unchanged. Mean and Median summarize numeric values; Mode uses the most frequent value. Earliest and Latest apply to dates and timestamps. Value uses a literal you supply. Default: None.

**Value**

Shown in the column's detail for the Value method. Enter the replacement using the column's type, such as 0 for a number. An incompatible value causes an error.

**Impute all**

Choose Mean for numeric columns, Mode for text and Earliest for dates and timestamps. Other types remain unchanged.

**Clear all**

Set every column to None and clear fixed replacement values.

**Replace What**

Null matches missing values. Null or empty also matches empty strings. Specific value matches the text representation of the value you enter. Default: Null.

**Match Value**

For Specific value, enter the value to replace, such as -1 when it represents a missing measurement.

**Separate Columns**

Keep the originals and append results named with \_imputed. When cleared, replace values in the original columns. Default: false.

**Add Flag**

Append a column ending in \_imputed\_flag for each selected column. It records whether the original cell matched Replace What, even if no replacement could be calculated. Default: false.

## Impute FAQs

**Does Mean use values filled earlier in the column?**

No. Statistics use the column's original non-NULL values across the whole input. With Specific value selected, that value still counts toward the statistic unless it's NULL.

**What if the entire column is missing?**

A statistic has no non-NULL values to use, so the result stays NULL. A compatible fixed Value can still fill those cells.

**Are empty strings and spaces the same as NULL?**

No. Null or empty includes empty strings but doesn't include strings containing only spaces.

**Does row order affect the result?**

Mean, Median, Earliest, Latest and fixed Value don't depend on neighboring rows. Mode picks one of the most frequent values. When values tie, don't rely on which one it picks.

### Prepare your data. Build it in Strata.

Strata opens in your browser, with no account.

[Open Strata](https://oplema.com/editor?path=%2F%3Fopen%3Dstrata) [About Strata](https://oplema.com/strata)
