varp()

Table of Contents

Definition

varp() returns the population variance in the table column. You can use it with the transform commands that support aggregations.

Examples

The following example returns the population variance of prices in sales_inventory dataset. rex4j is used for extracting prices from the _raw column. eval creates a new table column that contains only the year of the timestamp which is used for grouping the result.

%dpl
index=sales_inventory earliest="01/01/2017:00:00:00"
| rex4j field=_raw "price=(?<price>\d+)"
| eval year=strftime(_time, "%Y")
| stats varp(price) by year
example of varp() aggregation command

Further Reading