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

# AggText

> Use the Sigma AggText function to send a request to run an aggregate warehouse function that returns a text data type.

The **AggText** function sends a request to execute an aggregate warehouse function that returns a text data type. This function is the aggregation version of [CallText](/docs/calltext).

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

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

Function arguments:

* **function name** (required) - an aggregate warehouse function to execute
* **arguments** (required) - one or more arguments to pass to the warehouse function

All arguments must meet the warehouse function’s input requirements. Unsupported arguments result in an invalid formula.

## Example

A table contains a *Customer Name* column that generates each region's top five customers based on purchase activity. Using the **AggText** function, you can execute Snowflake's [MIN](https://docs.snowflake.com/en/sql-reference/functions/min) function in a higher grouped level of the table to return the first customer according to alphabetical order.

```
AggText("MIN", [Customer Name])
```

Returns the first *Customer Name* value (based on alphabetical order) for each region in the *Store Region* column.

![](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/e436327824ca61c9f0ebb910d0123d19af73aaf88b827c464458a2e0cd05c1e3/assets/docs-images/b5d45b8-2.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20260817%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260817T044416Z&X-Amz-Expires=604800&X-Amz-Signature=6b5f2a42653d11a02fcfabd131d1ec761a0797a4ac7dced5117e0ab8f168c153&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

## Related resources

* [CallText](/docs/calltext)