series_greater
This page explains how to use the series_greater function in APL.
The series_greater function compares two numeric arrays (series) element by element and returns a new array of Boolean values. Each element in the result is true if the corresponding element in the first array is greater than the corresponding element in the second array, and false otherwise.
You use this function when you want to evaluate pairwise comparisons across time series or numeric arrays. It’s especially useful in scenarios such as anomaly detection, trend analysis, or validating thresholds against observed metrics.
Usage
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
array1 | dynamic (array) | The first array to compare. |
array2 | dynamic (array) | The second array to compare. Must be the same length as array1. |
Returns
A dynamic array of Boolean values, where each element is true if the corresponding element in array1 is greater than the corresponding element in array2, and false otherwise.
Use case examples
When analyzing HTTP request durations, you can compare them against a fixed threshold to identify requests that exceed performance expectations.
Query
Output
| id | durations | threshold | above_threshold |
|---|---|---|---|
| u123 | [180,220,150,300] | [200,200,200,200] | [false,true,false,true] |
This query shows which requests for a given user exceed a threshold of 200 ms.
You can compare span durations across services to see where certain spans take longer than others.
Query
Output
| trace_id | frontend_spans | checkout_spans | longer_in_frontend |
|---|---|---|---|
| t1 | [30ms,50ms,10ms] | [20ms,40ms,15ms] | [true,true,false] |
This query compares span durations between frontend and checkoutservice services.
List of related functions
- series_greater_equals: Compares two arrays and returns
truewhen elements in the first array are greater than or equal to the second array. - series_less: Compares two arrays and returns
truewhere the first array element is less than the second. - series_less_equals: Compares two arrays and returns
truewhere the first array element is less than or equal to the second. - series_not_equals: Compares two arrays and returns
truewhere elements aren’t equal.