The min aggregation function in APL returns the minimum value from a set of input values. You can use this function to identify the smallest numeric or comparable value in a column of data. This is useful when you want to find the quickest response time, the lowest transaction amount, or the earliest date in log data. It’s ideal for analyzing performance metrics, filtering out abnormal low points in your data, or discovering outliers.

For users of other query languages

If you come from other query languages, this section explains how to adjust your existing queries to achieve the same results in APL.

Usage

Syntax

summarize min(Expression)

Parameters

  • Expression: The expression from which to calculate the minimum value. Typically, this is a numeric or date/time field.

Returns

The function returns the smallest value found in the specified column or expression.

Use case examples

In this use case, you analyze HTTP logs to find the minimum request duration for each unique user.

Query

['sample-http-logs']
| summarize min(req_duration_ms) by id

Run in Playground

Output

idmin_req_duration_ms
user_12332
user_45645

This query returns the minimum request duration for each user, helping you identify the fastest responses.

  • max: Returns the maximum value from a set of values. Use max when you need to find the highest value instead of the lowest.
  • avg: Calculates the average of a set of values. Use avg to find the mean value instead of the minimum.
  • count: Counts the number of records or distinct values. Use count when you need to know how many records or unique values exist, rather than calculating the minimum.
  • sum: Adds all values together. Use sum when you need the total of a set of values rather than the minimum.
  • percentile: Returns the value at a specified percentile. Use percentile if you need a value that falls at a certain point in the distribution of your data, rather than the minimum.