avg(), mean()

Table of Contents

Definition

avg() and mean() calculates the arithmetic mean for the selected table column.

Both avg() and mean() calculates the average in the same way. mean() uses avg() function for the calculation which therefore gives exactly the same value as avg().

You can use avg() and mean() with transform commands that support aggregations.

Examples

You can use avg() or mean() with timechart or other charting commands to calculate the arithmetic mean.

%dpl
index=crud earliest=-3y
| spath
| timechart avg(balance) by operation

example of avg() function

Further Reading