613-518-1166 info@zimdatabases.com

ZIM Language Reference

$total

< All Topics

$total

Sums a set of values, excluding those in which the expression is $Null.

Syntax

$total(expression)

Parameters

expression

any expression

Return Value

Number.

Comments

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.

Example

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.

 

See Also

$average

$count

$max

$min

About Functional Expressions

Number Literals

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents