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

# GreatestNonNull

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

## Syntax

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

**input 1** (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.

## Example

```
GreatestNonNull(Null, 2, 3)
```

* Returns `3`.

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

* Returns `-2`.

```
GreatestNonNull(0, [Airline Delay])
```

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

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

## Related resources

* [Max](/docs/max)
* [Least](/docs/least)
* [Greatest](/docs/greatest)
* [LeastNonNull](/docs/leastnonnull)