All Posts Tagged With: "Documents Actions Calculations"

Document Actions Series: Calculations

When discussing the Four51 Action library I strive to create relevant examples that match real world scenarios you may encounter in your own departments. In this calculation example I first thought I’d do a mortgage calculator. Then I realized that it would be extremely difficult to convey in a blog post and who’s getting mortgage loans in this credit crisis anyway. So, instead I’ll keep the calculation simple while still demonstrating the concept of chaining.

The formula is quite simple: (x * y) / z = Sum. So we have three numerators and two calculations to perform to reach our sum. This requires we use 2 document actions: Multiply and Divide. The key to accuracy is the order in which we list our document actions.

First, we’ll create the Multiply action. Take note that the SpecName argument is a constant type. We are assigning a value to a variable, so we must type the name of that variable as the argument value.

Method: Mutiply
Arguments:
NumberA (variable) =
NumberB (variable) =
SpecName (constant) = _x_y

Lastly, we’ll take the sum of the multiple operation and Divide it by the z value. Notice in this action we are using the value assigned to the _x_y variable by referring to the variable.

Method: Divide
Arguments:
NumberA (variable) = <_x_y>
NumberB (variable) =
SpecName (constant) = Sum

And we’re done. You can put the Sum variable anywhere in your template file and the calculated value will print. I didn’t demonstrate the formatting capabilities, but you should play with them. They are quite powerful.

This document action chaining example can be viewed and downloaded at the demo site. The product is named “Documents Actions Calculations“.

VN:F [1.9.0_1079]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.0_1079]
Rating: 0 (from 0 votes)
Google Buzz

Popularity: 54%

  • Share/Bookmark