range()
Table of Contents
Definition
range()
returns the difference between the maximum and minimum values of the table column. The table column’s values must be numeric.
You can use range()
with transform commands that support aggregations.
Examples
The following example returns the difference between maximum and minimum values of balance column and groups results by date and operation column.
%dpl
index=crud earliest=-3y
| spath
| eval Date=strftime(_time,"%Y-%m-%d")
| rename count AS count_operation
| stats range(balance) by Date, operation