Calculations

Not all fields added to Library should be filled manually. Some of them can be calculated from other fields. Calculations field type allows you to create a simple calculated expression using the predefined list of math, strings, date/time and logical functions and fields as variables.

To add the calculations, click Add a new field from the Toolbar and choose the relevant option from the list of field types. To adjust an expression, follow the steps below:

Calculations

    1. Click Variables to add variables: any field from the Library.
    2. Click Functions to add a function. The new window will be opened. Here you will see the whole list of available functions grouped by their type: logical, date/time, strings and math. When you choose any, there’s a short description in the left side of the window. To add the chosen function to the expression container, click OK:
      Types of functions
    3. Choose the result type
    4. Click Run to check the calculations. You will need to choose an entry for a test. The expression result will be shown to the right from the icon.

On the screenshot above, Calculations field is used to find the total sum spent on some product by multiplying the price of the product and the number of product items purchased. Also, a logical functions is added here: it sets the total to $5.00 if the sum is less than $5.00 to avoid small sums for the general report. So, the expression looks as the following:

if(#{price}*#{quantity}<5,5,#{price}*#{quantity}), where

  • {#price} and {#quantity} are the fields from the same Library
  • #{price}*#{quantity}<5 is the condition
  • 5 will be returned if the condition is True
  • #{price}*#{quantity} will be returned if the condition is False

More detailed information can be found on the wiki.

Was this article helpful?

Related Articles