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

# AggVariant

> Use the Sigma AggVariant function to call a warehouse aggregate function that returns a Variant data type.

The **AggVariant** function calls a warehouse aggregate function that returns a Variant data type. This function is the aggregate version of [CallVariant](/docs/callvariant) and can be applied to identify distinct values from a lower grouped level in the parent/higher level grouping of a table.

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

## Syntax

```
AggVariant(function name, arguments...)
```

Function argument&#x73;**:**

* **function name** (required): The name of an aggregate function supported by your data warehouse.
* **arguments** (required): One or more arguments to be passed to the warehouse function. All arguments must meet the warehouse function’s input requirements.

## Example

A table contains an `ARRAY_UNIQUE_AGG` column that returns an array containing all the distinct customers who purchased at least one or more items per *Product Type*. You can pass Snowflake's [ARRAY\_UNION\_AGG](https://docs.snowflake.com/en/sql-reference/functions/array_union_agg) function to the **AggVariant** function to identify all distinct customers who made at least one purchase that week.

The `ARRAY_UNION_AGG` function takes in one column containing the arrays with distinct values as produced by Snowflake's [ARRAY\_UNIQUE\_AGG](https://docs.snowflake.com/en/sql-reference/functions/array_unique_agg) function.

```
AggVariant("ARRAY_UNION_AGG", [ARRAY_UNIQUE_AGG])
```

* Return an array that contains the union of distinct customers from the input arrays in the `ARRAY_UNIQUE_AGG` column.

![](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/ab75ed3dd19497d2a4c0da4e5346ee9571ab429344f3327fb321f1889495790d/assets/docs-images/6e5114f-3.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=20260725T065254Z&X-Amz-Expires=604800&X-Amz-Signature=ce627bf6bce73bf5d8bdcd7c9f248f9a6010f781e7aaad50d99e8fd31f3de925&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Related resources

* [CallVariant](/docs/callvariant)