> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# MovingMin

> Use the Sigma MovingMin function to find the minimum value of a column within a moving window.

The **MovingMin** function finds the minimum value of a column within a moving window.

## Syntax

```
MovingMin(column, above, [below])
```

Function Arguments:

* **column** (required) - The column to be searched.
* **above** (required) - The first row to include, counting backward from the current row.
* **below** (optional) - The last row to include, counting forward from the current row. Defaults to 0 (current row will be the last row included).

When using this function without a sort enforced, there can be unexpected results. In order to ensure that the values are stable, verify that there is a sorted column within the table.

## Example

A table lists the weekly sales for the past year.  The table is sorted ascending by the week.  The **MovingMin** function can be utilized in order to find the minimum value within specific windows.

```
MovingMin([Weekly Sales], 4)
```

With \[Weekly Sales] as the **column** argument and 4 as the **above** argument, the minimum weekly sales value is calculated for each week along with the four previous weeks. Because the **below** argument is not specified, it defaults to 0.  

![A table with Week of Date, Weekly Sales, and Moving Min columns, highlighting the current week and four previous weeks of sales that produce a moving minimum of \$13,202,801.15 for the week of 2022-09-11.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/272a906d55c5bcb81e3663b9c3bb56a70ae9fb0974dc0ed6e8f727d500460dc2/assets/docs-images/b573f44-11.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260725T033753Z&X-Amz-Expires=604800&X-Amz-Signature=35a03f98a163f010ccd9327d1d1cec3dae4130f6299ed87b0623a005a2c935a5&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

```
MovingMin([Weekly Sales], 0, 4)
```

Here, the **above** argument is 0, so there isn't any previous weeks included in the minimum calculation. The **below** average is 4, the minimum weekly sales value is computed for each week along with the next 4 weeks.

![A table with Week of Date, Weekly Sales, and Moving Min columns, highlighting the week of 2022-08-14 and the next four weeks of sales, which produce a moving minimum of \$13,202,801.15 for that week.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/fd4ebb4d2940fb1b29809ed164c76da6104c6741b07955dbe36cee07cabf8d77/assets/docs-images/e467e32-22.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260725T033753Z&X-Amz-Expires=604800&X-Amz-Signature=0c776adedb8ea0114e8aa1255713e3f19cb8c067549f66c93bf0867ca7e2ec10&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

```
MovingMin([Weekly Sales], 2, 2)
```

Here, the **above** argument is 2, so the previous two weeks is included in the minimum calculation. In addition, the **below** argument is 2, so the following two weeks is also included.

![A table with Week of Date, Weekly Sales, and Moving Min columns, highlighting the two weeks before and after 2022-08-28, which produce a moving minimum of \$13,202,801.15 for that week.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/c6b9395c480b428b51bea3e4dde0670789d7ba01dead6cf49aec5d44d33aeb19/assets/docs-images/9527048-33.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260725T033753Z&X-Amz-Expires=604800&X-Amz-Signature=d3fe90bf56d6b775f062e784a810c6bebc65f4ce2203947a30f1c404c8944b1d&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

```
MovingMin([Weekly Sales], 8, -4)
```

Here is an example where the **below** parameter is negative. The **below** parameter can be negative as long as the value is less than that of the **above** parameter. In this example, each window begins 8 weeks before the current week and ends 4 weeks before the current week, inclusive.

![A table with Week of Date, Weekly Sales, and Moving Min columns, highlighting the window from eight to four weeks before 2022-10-09, which produces a moving minimum of \$13,202,801.15 for that week.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/f976cbfd5ee11f941e9a19c71537dfa7f04361094e1fa017f631fa0776f03fa7/assets/docs-images/9e441cb-44.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260725T033753Z&X-Amz-Expires=604800&X-Amz-Signature=841a67bad9783b54dfc88603231ab14dec0b6d278e3c4ffcfd1261aeb675ea9f&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Related resources

* [CumulativeMin](/docs/cumulativemin)
* [Min](/docs/min)
* [MovingMax](/docs/movingmax)