060-680 MetaTool Extraction Edit – Calculate Date
With the MetaTool Calculate Date rule, you can calculate a date by adding or subtracting a value from another date. Common examples are calculating a Deadline Date or a Due Date for Invoices.
You typically define a Set field value rule first to set the index field holding the number of days. Next, you would extract and format the Date on the document and define a Calculate Date rule.
01 Calculate Date – Add Rule
Calculate Date is defined in the MetaTool Extract tab.
Press the Add button and select Edit – Calculate – Date to add the edit rule.
02 Calculate Date – Setup
In our example we will make use of the CB MetaTool Floating Data job. This job is automatically installed when you install CaptureBites MetaTool.
We want to calculate the Deadline Date for the document sample below. We first add a Set field value rule for the index field “Deadline in Days”, then we extract and format the Date of Reception from each document and finally add a Calculate Date rule.
With a Set field value rule, we set the value for the index field “Deadline in Days” to 9:
Finally, we define the Calculate Date rule. We select the index field that will hold the final result, in this case, “Deadline Date”.
Optionally we enter a description.
03 – Source field: select the source index field that contains a date. Note that the value needs to match the format set in the Source format. In our example, we use the index field “Date” holding the extracted Date of Reception as the Source field.
04 – Source format: here you enter the format that corresponds with the Source date, in our case, the source format is MM/DD/YYYY, the format of the extracted date of reception of the document. You can also press the Setup button to select different format types to compose your date format.
05 – Output format: here you enter the format of the output date, the Deadline Date. In our case, it’s MM/DD/YYYY. You can also press the Setup button to select different format types to compose your output date format.
06 – Operation: here you select which function should be applied. You can add or subtract the number of days. In our case, we want to add the days to calculate the Deadline Date, so we select the “+” symbol.
07 – Days: select the index field containing the number of days that should be added to the Source field. In our case, we use Deadline in Days.
The final result will look like this, the first one being the original Date of Reception, and the second the Deadline Date: