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
| Part | Value | Effect |
|---|---|---|
\# CurrencyCulture1 | CurrencyCulture1 (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 code | For example en-US | The language and region whose currency format the total uses. See CurrencyCulture for the list of codes. |
Where to add it
- In your Word template, add
{{AUTOSUM(ABOVE)\# CurrencyCulture1}}to the cell below the column you want to total. - Define
CurrencyCulture1as 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 name | Quantity | Price |
|---|---|---|
{{TableStart:Opportunity.r.OpportunityLineItems}}{{Name}} | {{Quantity}} | {{TotalPrice \# CurrencyCulture1}}{{TableEnd:Opportunity.r.OpportunityLineItems}} |
{{AUTOSUM(ABOVE)\# CurrencyCulture1}} |
Output:
| Product name | Quantity | Price |
|---|---|---|
| Burlington Textiles Weaving Plant Generator GenWatt Diesel 1000kW | 1 | $10,000.00 |
| Burlington Textiles Weaving Plant Generator SLA: Bronze | 2 | $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
TableStartandTableEndtags 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
CurrencyCulture1is defined on the solution with the culture code you want. See Dates, numbers or currency show the wrong format.