---
schema_version: "1"
id: bfb91b479fec8be83e0db998e16fd235b47f7f158f2ca991e341d9f2f1c6f7c6
title: ANY_VALUE
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/aggregate-func/any-value.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/any-value.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 012be58037cd7b23c06beb01ee65833bcb4ee823546c835d05c570d481a3add7
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `ANY_VALUE`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns an arbitrary value from the set of input values. The result is non-deterministic.

## Syntax

```sql
any_value(<expression>)
```

## Arguments

### Required

- `<expression>`: An expression of any type.

## Returns

Returns a value of the same type as the input expression. Returns NULL if no rows are selected.

## Considerations

- The value returned is implementation-defined and non-deterministic.
- Useful when you need any value from a group but don't care which one.
- Returns NULL when applied to an empty set.

## Examples

### Get Any Value from Group

Select an arbitrary value for each group.

```sql
SELECT department, any_value(employee_name) AS sample_employee
FROM employees
GROUP BY department;
```

Returns one employee name per department (which one is not guaranteed).

## Related Documentation

- [Aggregate Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/aggregate.md)
- [GROUP BY Clause](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/sql-commands/select-group-by.md)
