sum()
Table of Contents
Definition
sum()
aggregation sums all values in the selected table column. You can use it with the transform commands that support aggregations.
Examples
The following query sums all counted operations and groups them by timestamp and operation. The spath
command extracts the JSON data, eval
formats the timestamp into YYYY-MM-DD
and stats
creates the graphic with sum()
aggregation.
%dpl
index=crud earliest=-3y
| spath
| eval Date=strftime(_time,"%Y-%m-%d")
| rename count AS count_operation
| stats sum(count_operation) by Date, operation
| sort Date