Sums a set of values, excluding those in which the expression is $Null.
$total(expression)
| expression | any expression |
Number.
Expression is often a WHERE expression that includes only selected values in the totalling operation. If the WHERE expression (expr1 WHERE expr2) is true, the expr1 value is included in the operation; otherwise, expression is considered $Null and is not included.
compute Employees where DeptName="Sales" \
evaluate(let TotSal = $total(Salary)) \
(let TotSalF = $total(Salary where Sex = "F"))
Finds the total of all employees' salaries, and the total of the salaries of all female employees, in the Sales department.