SUM(SOURCE, DESTINATION [, NORESET]) - totals data field or report variable.

Source - data field or report variable to sum.
Destination - report variable to store result of the function.
Noreset - use this option if you don't want to initialize destination variable with zero value. New values of the source field will be added to the previous result of the function.

Example of a report:

\scan(a)\
\a:number\ - \a:value\
\endscan, sum(a:value,s_value)\
total: \s_value\

\scan(b)\
\b:number\ - \b:value\
\endscan, sum(b:value,s_value,noreset)\
All totals: \s_value\

Result may be like this:

1 - 5
2 - 10
3 - 4
total: 19

1 - 10
All totals: 29

Next topic: Ctn function