#1
|
|||
|
|||
Simple Calculation with a Merge Field
Good Morning,
I am trying to write the code that takes a merge field, and subtracts 1, and displays the result. Here is what I have, does it look correct? {{= {MERGEFIELD TableStart:BorrowerProductQuery \*MERGEFORMAT}{MERGEFIELD Selected_Product_Term_Months \* MERGEFORMAT}{MERGEFIELD TableEnd:BorrowerProductQuery \*MERGEFORMAT} - 1 \# "0" *MERGEFORMAT}} I am using Conga Composer to "build" the Word Doc, and the Merge Field is coming from a Conga Query, hence the "TableStart" & "TableEnd" merge fields. The actual field value I need is called "Term_Months". An example is, if the "term" of a loan is 60 months (This is the value in the field Term_Months), I need need the formula to return a value of "59". I hope this makes sense. Is the formula correct? Thanks Paul, Shawn Low |
#2
|
|||
|
|||
Formula is not correct
Do here is what I get when I generate the Doc:
{ = 120 - 1 \# "0" * MERGEFORMAT } So, obviously something is wrong. The value of 120 that is showing, is actually the correct "term" in the test case Im using. The formula is not actually doing the math (120 - 1) and showing 119. Should I be using the {QUOTE} functionality? Thanks Shawn |
#3
|
|||
|
|||
Working Now
Through trial and error, I managed to get this working correctly.
The formula that worked looks like this: { = {MERGEFIELD TableStart:YourCongaQuery \*MERGEFORMAT}{MERGEFIELD Your_Merge_Field \* MERGEFORMAT}{TableEnd:YourCongaQuery \*MERGEFORMAT} - 1 \# "0" \*MERGEFORMAT} For those "Not" using Conga Composer to generate your document, simply take out the two (2) Merge Fields "TableStart" & "TableEnd". The formula would look like this: { = {MERGEFIELD Your_Merge_Field \*MERGEFORMAT} -1 \# "0" *MERGEFORMAT} Thanks Shawn |
#4
|
||||
|
||||
Delete the \*MERGEFORMAT switches - they add nothing useful here.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
math, merge field |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to prevent the auto-calculation of the '% Complete' field in MS Project Professional 2013? | VivekG1 | Project | 1 | 02-06-2015 05:33 AM |
Trying to round up a field based on a calculation but getting error messages | bakerrl | Excel | 19 | 10-14-2014 05:44 AM |
Form field calculation returning 2x correct result | Jschueller | Word | 1 | 08-20-2013 01:51 PM |
Prevent Field Calculation with Dates from introducing line break? | ztag | Word | 1 | 01-13-2012 04:13 PM |
Mail Merge Calculation Error | Lsbutler2000 | Mail Merge | 1 | 06-22-2007 06:33 AM |