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

# Coalesce

> Use the Sigma Coalesce function to return the value of the first argument that is not Null.

The **Coalesce** function returns the value of the first argument that is not `Null`. This function is often applied to one or more columns of data to check for `Null` values and assign the placeholder value in replacement of `Null`.

**Coalesce** is not an aggregate function and is not to be confused with [FirstNonNull](/docs/firstnonnull), which returns the row of a column with the first non-Null value.

## Syntax

```
Coalesce(argument 1, ...)
```

**argument 1** (required)- The number, date, string, column, or function to be evaluated. 

**argument 2+** (optional)- The additional arguments to be evaluated.

Arguments must all be of the same data type. If you need to evaluate different types of arguments, you can use [Text](/docs/text) to force the **Coalesce** function to read the input as a string.

If all arguments to be evaluated are `Null`, `Null`is returned.

## Example

```
Coalesce(Null, 1/0, 1/1, 1/2) = 1
```

* Returns the third argument as it is the first non-Null value.

```
Coalesce([Sales], 0)
```

* Converts all the Null values in *Sales* to 0.

```
Coalesce([Profit]/[Sales], 0)
```

* Return profit per sale when *Sales* >0; return 0 if there are no sales. This avoids creating unintentional `Null` values when the formula encounters situations that divide by 0.

If you want a report that lists Product Types for all purchase transactions, you can use the **Coalesce** function to search multiple columns for the first non-Null value per row.

```
Coalesce([Product Type], [Product Family], [Sku Number])
```

* Return *Product Type* if it exists; return *Product Family* if there is no Product Type. If both *Product Type* and *Product Family* do not exist, return *SKU Number.*

![](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/f2dfc4ed57bcded5238332890dc9334523c32e9256334a3ad3e66370d63790ef/assets/docs-images/9aa504b-ll.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260727%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260727T163359Z&X-Amz-Expires=604800&X-Amz-Signature=a84e49f583c5e13e1b8af5f37eb2e6446da788fe9eecc0f4691c8493c2ce4cab&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

Alternatively, assume the role of a business owner who is updating pricing to reflect the seasonal discount for one of their product types. You can use the **Coalesce** function on a non-constant argument to assign a placeholder value if no discount exists for the product type. 

```
Coalesce([Discounted Price], [Sticker Price])
```

* Return *Discounted Price* if discount data exists, otherwise return *Sticker Price.*

![](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/1e97be4f5bfef047820b10c0992668a5f766ebd8005d380be60b8acdc21987d3/assets/docs-images/7ef8aef-Screen_Shot_2023-04-16_at_6.54.23_PM.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260727%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260727T163359Z&X-Amz-Expires=604800&X-Amz-Signature=64cb626f533ff78b3ac3cc10d5bcfc988074df0fef1010cd037418843929b890&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Related resources

* [If](/docs/if)
* [IsNull](/docs/isnull)
* [Zn](/docs/zn)