Create a Simple Formula
Here are the steps to create a simple formula, one that adds two currency fields together.
In this example, Contract.Total of Payments is chosen.
Adding an IF Statement to a Word 2016 Document Template in ASPIRE
There are known limitations to this work around.
Create an IF Statement
The statement is going to be “If my amount financed is $10,000, display the Commencement Date, if it’s not $10,000, display the First Payment Date”.
This example will use Amount Financed, Acceptance Date, First Payment Date.
List of my document tags I want to use:
Amount Financed: <LTF>DocGenConContract.Amount Financed</LTF>
Acceptance Date: <LTF>DocGenConContract.Acceptance Date</LTF>
First Payment Date: <LTF>DocGenConContract.1st Payment Date</LTF>
Below is a list of modifiers.
The standard ASPIRE field tag modifiers do not work within formulas. The Word Number Format switch ( \# ) must be used to format number results, including percentages and currency. To use the switch, follow the \# with a space, a quotation mark, the format for the numbers and a closing quotation mark
Number and Currency Formats
Result
\# "$#,##0.00" - Currency
Example: { =<LTF>DocGenConContract.Equipment Original Cost</LTF> - <LTF>DocGenConContract.Finance Charge</LTF>\# "$#,##0.00")}
Result: $717,312.44
\# "$#,##0.00;($#,##0.00) - Currency with negative numbers displayed within parenthesis
Example: { =<LTF>DocGenConContract.Finance Charge</LTF> - <LTF>DocGenConContract.Equipment Original Cost</LTF>\# "$#,##0.00;($#,##0.00")}
Result: ($45,983.12)
\# "$#,##0.00;-$#,##0.00 - Currency with negative numbers displayed after a negative sign
Example: { =<LTF>DocGenConContract.Finance Charge</LTF> - <LTF>DocGenConContract.Equipment Original Cost</LTF>\# "$#,##0.00;-$#,##0.00"}
Result: -$45,983.12
Percentage formats the results with a percentage sign. The presence of a % character in a format string causes a number to be multiplied by 100 before it is formatted.
Be aware of the format of the fields referenced. If the values are already in a percentage format. (E.g. 0 Yield vs Yield %. Without formatting, Yield would display as .98 versus Yield % as 98.) The Percent modifier converts the decimal to a percentage display and uses the # and 0 the same as Number and Currency formatting.
Percentage Formats
Result
Formatting Formula Dates
The Format as Short Date and Format as Long Date tags do not work when the displayed date is the result of a formula. You will need to use the Word Date Format switch \@ .
Formula Example: { IF "<LTF>DocGenConContract.Start Date</LTF>" <> "" "<LTF>DocGenConContract.Start Date</LTF>" "" \@ "MMMM dd,yyyy"}
Result: March 03, 2008
Options:
\@ "dddd, MMMM dd, yyyy" = Displays as - Tuesday, October 21, 2008
\@ "MMMM d, yyyy" = Displays as - October 21, 2008
\@ "d MMMM yyyy" = Displays as - 21 October 2008
\@ "M/d/yyyy h:mm tt" = Displays as - 10/21/2008 10:19 AM
d - Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero.
dd - Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero.
ddd - Represents the abbreviated name of the day of the week.
dddd - Represents the full name of the day of the week.
M - Represents the month as a number from 1 through 12. A single-digit month is formatted without a leading zero.
MM - Represents the month as a number from 01 through 12. A single-digit month is formatted with a leading zero.
MMM - Represents the abbreviated name of the month.
MMMM - Represents the full name of the month.
y - Represents the year as at most a two-digit number. If the year has more than two digits, only the two low-order digits appear in the result. If the year has fewer than two digits, the number is formatted without a leading zero.
yy - Represents the year as a two-digit number. If the year has more than two digits, only the two low-order digits appear in the result. If the year has fewer than two digits, the number is padded with leading zeroes to achieve two digits.
yyyy - Represents the year as a four-digit number.
h - Represents the hour as a number from 1 through 12. A single-digit hour is formatted without a leading zero.
hh - Represents the hour as a number from 01 through 12. A single-digit hour is formatted with a leading zero.
H - Represents the hour as a number from 0 through 23. A single-digit hour is formatted without a leading zero.
HH - Represents the hour as a number from 00 through 23. A single-digit hour is formatted with a leading zero.
m - Represents the minute as a number from 0 through 59. A single-digit minute is formatted without a leading zero.
mm - Represents the minute as a number from 00 through 59. A single-digit minute is formatted with a leading zero.
t - Represents the first character of the AM/PM designator.
tt - Represents the AM/PM designator.