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.Splunk SPL users
Splunk SPL users
In Splunk, the
min
function works similarly to APL’s min
aggregation, allowing you to find the minimum value in a field across your dataset. The main difference is in the query structure and syntax between the two.ANSI SQL users
ANSI SQL users
In ANSI SQL, the
MIN
function works almost identically to the APL min
aggregation. You use it to return the smallest value in a column of data, grouped by one or more fields.Usage
Syntax
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.QueryRun in PlaygroundOutput
This query returns the minimum request duration for each user, helping you identify the fastest responses.
id | min_req_duration_ms |
---|---|
user_123 | 32 |
user_456 | 45 |
List of related aggregations
- 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.