---
schema_version: "1"
id: 714ffd520a145657554176800eaca85bb4fca64fd3678fec6b2404bbc9cca276
title: min()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/concept/bi-saql-fn-agg-min.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-min.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 82675107b1ea0e061261dff8db4c72861ef09c6b5857b5fac758b6c071eb207d
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# min()

Returns the minimum value of a dimension or measure field.

## Example - Find the Smallest Opportunity For Each Account

```nolang
q = load "Ops";
q = group q by 'Account_Name';
q = foreach q generate 'Company' as 'Company', min('Amount') as 'Smallest Deal';
```

## Example - Find the First Value in List of Airline Destinations per Origin

For dimensions, `min()` sorts the values alphabetically and the first value is returned.

```nolang
q = load "Airlines";
q = group q by 'origin';
q = foreach q generate 'origin' as 'Origin', min('dest') as 'Min Destination';
```

**See Also**

- [max()](https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-fn-agg-max.md)
