# ArrayAggDistinct

The **ArrayAggDistinct** function identifies distinct non-null row values in a column or group and aggregates them into a single array.

### Syntax

```
ArrayAggDistinct(value, [direction])
```

Function arguments:

|               |                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **value**     | (required) The column containing values to join.                                                                                                                                                                                                                                                                                                                                                                                                             |
| **direction** | <p>(optional) The directional order to sort the column values.</p><ul><li><code>“asc”</code> sorts values in ascending order.</li><li><code>“desc”</code> sorts values in descending order.</li></ul><p>When a direction isn’t specified, Analytics Pro sorts values in the same order as the column referenced in the <strong>value</strong> argument. If the referenced column isn’t sorted, Analytics Pro sorts values in ascending order by default.</p> |

### Example

```
ArrayAggDistinct([Product Type], “asc”)
```

For each grouping (grouped by order number) the **ArrayAggDistinct** function returns an array containing distinct non-null values—sorted in ascending order—from the corresponding rows in the *Product Type* column.

<figure><img src="https://files.readme.io/e409c19-image.png" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.meetuma.ai/uma-knowledgebase/data-and-reporting/analytics-pro/functions/aggregate-functions/arrayaggdistinct.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
