> 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.

# LeastNonNull

Returns the smallest value from two or more values with matching data types, ignoring `Null` values.

## Syntax

```
LeastNonNull(input1, [input2], ...)
```

**input** (required) The data or column of data to be evaluated. Input can be numbers, dates, or strings.

**input 2+** (optional) Additional inputs to compare. All additional inputs must match the type of the first input.

## Notes

* If all inputs are `Null`, returns `Null`.
* To compare two values of different data types, convert one of the values to match the data type of the other using the appropriate type conversion function. For example, you can convert a string to a number using the [Number](/docs/number) function, or to a date using the [Date](/docs/date) function.

## Examples

```
LeastNonNull(Null, 2, 3)
```

* Returns `2`.

```
LeastNonNull(Null, -2, -4)
```

* Returns `-4`.

```
LeastNonNull(0, [Arrival Delay])
```

* In a calculated column, returns the greater of 0 or the value in the *Arrival Delay* column for each row. If *Arrival* Delay\_ is `Null`, returns `0`.

![A table of flight data shows a column, Arrival Delay, next to a LeastNonNull calculation. Each row of Arrival delay has a positive delay time, negative delay time, or Null, while LeastNonNull contains only negative delay times or 0](https://files.buildwithfern.com/sigma.docs.buildwithfern.com/1c4adb41af5067837da29deb84b370e47e65046814506be61166b46f1fd636a4/assets/docs-images/97073eaa65c1aeac5a9e4000ea2b1fcf8b56545a4d689dfcf0da7b9db69a9e37-LeastNonNull_Flight.png)

## Related resources

* [Min](/docs/min)
* [Greatest](/docs/greatest)
* [Least](/docs/least)
* [GreatestNonNull](/docs/greatestnonnull)