This page explains how to use the variance aggregation function in APL.
variance
aggregation function in APL calculates the variance of a numeric expression across a set of records. Variance is a statistical measurement that represents the spread of data points in a dataset. It’s useful for understanding how much variation exists in your data. In scenarios such as performance analysis, network traffic monitoring, or anomaly detection, variance
helps identify outliers and patterns by showing how data points deviate from the mean.
Splunk SPL users
stats
command with the var
function, whereas in APL, you can use variance
for the same functionality.ANSI SQL users
VAR_POP
or VAR_SAMP
. APL provides a simpler approach using the variance
function without needing to specify population or sample.Expression
: A numeric expression or field for which you want to compute the variance. The expression should evaluate to a numeric data type.variance
function to measure the variability of request durations, which helps in identifying performance bottlenecks or anomalies in web services.Queryvariance_req_duration_ms |
---|
1024.5 |
stdev
when you need the spread of data in the same units as the original dataset.avg
with variance
to analyze both the central tendency and the spread of data.count
alongside variance
to get a sense of data size relative to variance.percentile
for a more detailed distribution analysis.max
when you are looking for extreme values in addition to variance to detect anomalies.