$average
Welcome to our Knowledge Base
Documentation | Blog | Demos | Support
< All Topics
Print
$average
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
Returns the average value of a set of values, excluding $Null values.
Syntax
$average(expression)
Parameters
expression | any expression |
Return Value
Number, with the number of decimal places implied by expression.
Comments
The function calculates the average of a set of values, excluding $Null values.
Expression is often a WHERE expression that includes only selected values in the averaging operation. If the WHERE expression (expr1 WHERE expr2) is true, the expr1 value is included in the averaging operation; otherwise, expression is considered $Null and is not included in the averaging operation.
Example
compute Employees where DeptName="Sales" evaluate (let AvgAge = $average($year($date)-$year(BirthDate))) (let AvgSal = $average(Salary where Sex = "F"))
Finds the average age of all employees, and the average salary of all female employees, in the sales department.
report footing $average(Salary) ($total(Salary*Salary) / $count(Salary) - $average(Salary) * $average(Salary))
Reports average salary and salary variance.
See Also
Updated
ByJason Lee
Was this article helpful?
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
5