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

# ArrayCompact

> Use the Sigma ArrayCompact function to remove null values from an array and return the resulting array.

This function isn't compatible with all data platform connections. To check if your connection supports it, see [Supported data platforms and feature compatibility](/docs/region-warehouse-and-feature-support#supported-data-platforms-and-feature-compatibility).

The **ArrayCompact** function removes null values from an array and returns the resulting array.

## Syntax

```
ArrayCompact(array)
```

### Function arguments

|           |                                             |
| :-------- | :------------------------------------------ |
| **Array** | The input array to remove null values from. |

## Usage notes

* The input array should be constructed with an [Array](/docs/array-functions) function.
* If the input argument is null, the function returns `null`.

## Examples

```
ArrayCompact(Array("East", "New York", Null))
```

Removes `Null` from the array and returns the array `["East", "New York"]`.

```
ArrayCompact(Array(Null, Null, Null))
```

Removes all nulls from the array and returns an empty array, `[]`.

```
ArrayCompact(Null)
```

Because the input argument is null, returns `Null`.