In performing merges that include detail regions, you may wish to include the total of a numeric column. This can be accomplished in the Word® template.

See AutoSum(Above) if you are working with international currencies.

Name: SUM(ABOVE)

Usage: See the tables below for example usage, syntax, and output.

Note: The number of columns in the row with the SUM(ABOVE) field must match the number of columns in the rows above it. You can turn off table borders to “hide” cells if needed.

Usage and Syntax in a Table:

ProductQuantityTotal Price
{{TABLESTART:OPPLINEITEMS}}{{OPPORTUNITY_LINEITEM_PRODUCTNAME}}{{OPPORTUNITY_LINEITEM_QUANTITY}}{{OPPORTUNITY_LINEITEM_TOTALPRICE}}{{TABLEEND:OPPLINEITEMS}}


{{=SUM(ABOVE)}}

Output:

ProductQuantityTotal Price
GenWatt Diesel 1000kW (Products)2200000
GenWatt Gasoline 2000W (Products)1150000


350000

When using the AUTOSUM(ABOVE) or SUM(ABOVE) functions to total an international currency field that dynamically formats currency with the currency culture parameter within an IF statement, the merged total amount displays in the running user's currency (determined by their locale), as opposed to the value determined by the currency culture parameter. A workaround for this scenario is building a Salesforce formula field that converts the international currency field's value into a number value. Then use an aggregated SUM query for that formula field and use the \# Currency picture switch in the merge field added to the template.