> 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://files.buildwithfern.com/sigma.docs.buildwithfern.com/e436327824ca61c9f0ebb910d0123d19af73aaf88b827c464458a2e0cd05c1e3/assets/docs-images/b5d45b8-2.png)

## Related resources

* [CallText](/docs/calltext)