AUTOSUM(ABOVE) adds up all numeric values in the same column above the cell where you place it, like Sum(Above). Unlike Sum(Above), it also formats the total as currency using a CurrencyCulture setting, so totals appear in the correct regional format. This makes it a good fit for multi-currency templates and documents for international audiences.

Syntax

It has two parts. In the template, below the column to total:

{{AUTOSUM(ABOVE)\# CurrencyCulture1}}

On the solution, the culture it uses, as an Other Parameter:

Parameter Name:  CurrencyCulture1
Parameter Value: en-US

Docs Made Easy adds each Other Parameter to the solution's button URL (see Parameters explained), where it reads:

&CurrencyCulture1=en-US

Values

PartValueEffect
\# CurrencyCulture1CurrencyCulture1 (or CurrencyCulture2 and so on)Formats the total with the culture code defined under that name on the solution. Required: AUTOSUM(ABOVE) must be combined with a CurrencyCulture parameter.
Culture codeFor example en-USThe language and region whose currency format the total uses. See CurrencyCulture for the list of codes.

Where to add it

  1. In your Word template, add {{AUTOSUM(ABOVE)\# CurrencyCulture1}} to the cell below the column you want to total.
  2. Define CurrencyCulture1 as an Other Parameter on your solution's Assign Behaviors page. See CurrencyCulture.

Example

Input: an opportunity with two line items, total prices 10000 and 2000.

Template table:

Product nameQuantityPrice
{{TableStart:Opportunity.r.OpportunityLineItems}}{{Name}}{{Quantity}}{{TotalPrice \# CurrencyCulture1}}{{TableEnd:Opportunity.r.OpportunityLineItems}}
{{AUTOSUM(ABOVE)\# CurrencyCulture1}}

Output:

Product nameQuantityPrice
Burlington Textiles Weaving Plant Generator GenWatt Diesel 1000kW1$10,000.00
Burlington Textiles Weaving Plant Generator SLA: Bronze2$2,000.00
$12,000.00

Works in

Word (DOCX) templates: the example on this page is a Word table. AUTOSUM(ABOVE) is available in Basic and Pro.

Notes

  • AUTOSUM(ABOVE) must be combined with a CurrencyCulture parameter.
  • If you only need the numeric total, without currency formatting, use Sum(Above).

Common errors

  • The document doesn't generate and reports a template syntax error. Check the tag is written exactly as {{AUTOSUM(ABOVE)\# CurrencyCulture1}}. See DME-TPL-000.
  • The total is wrong because rows are missing or repeated. The TableStart and TableEnd tags must be in the first and last cells of the same row, with the total row outside them. See Related-list tables are empty, show one row or repeat.
  • The total has the wrong currency format. Check that CurrencyCulture1 is defined on the solution with the culture code you want. See Dates, numbers or currency show the wrong format.