Document formulas

Written by Support Ubikey
Updated 4 weeks ago

What is a document formula?

A document formula is a value calculated at the document scale from variables coming from other document formulas or from post-it extended fields. Used variables can be of numeric, duration or date type.

The result of a document formula can be of numeric, duration or date type depending on the specified expression.

This value will be available in your document and can be used to create filters, calculation fields or others document formulas. 

Document formulas are calculated automatically in real time from the variables used to define it.

The document formula tab

Start by clicking on the "Document formulas" icon (1) in the toolbar.

If you just started using formulas, this tab is probably empty.

For each line you can find : the formula's name, its definition and its calculated value.

Here for exemple, the formula "Takt time" (2) is composed of the variables "Temps d'ouverture" and "Besoin client", defined above, and the result of the calculation is 420.

Create a document formula

In order to create a formula, click on "New formula" (3).

(4) Type a name for your formula.

(5) Define your formula : you can use numeric values, basic operators (+, -, /, *, (, ) ) and variables from your document.

To call a variable, use the @ key of your keyboard and choose the variable in the list.

(6) Search for a variable

(7) Filtrer the variables list by type.

(8) List of available variables, click on a variable to add it to the expression. 

(Détail of available variable types.)

For variables from the post-its fields (each post-it can have a value for the field), 4 functions are availables :

  • Sum (of all values entered on the post-its)
  • Average (of all values entered on the post-its)
  • Min (smallest value among entered values on the post-its, earliest value for dates)
  • Max ( biggest value among entered values on the post-its, latest value for the dates)

Attribution of a type (unit) to the formula

(8) While entering an expression, a type (numeric, duration or date) will be automatically attributed to the formula depending on the used variables (see : Detail of variable operation)

Errors management

Some operations are not autorised because they are mathematically invalid or because we do not support the resulting unit (see: Detail of operation on variables)

(9) The formula field displays an error and the error details below. You must edit the expression or convert a variable (see below) to make the formula valid again. 

Conversion of variables

In some cases it might be usefull to convert a duration variable into a numeric variable to solve an invalid operation. For that, right click on the variable you want to convert and choose the conversion unit.

For example : I want to convert my duration variable (value = 2 minutes) into a numeric variable in seconds (value = 120).

You can also convert a numeric variable into a duration variable with the same process.

Edit an existing formula.

To edit a document formula, click on the "menu" icon next to the formula and select "Edit".

You can change the name and the expression of the formula (see above).

(10) In the case of a change that would lead to a type change for the formula, the "Dependencies" section enables you to check if the formula is used elsewhere (document formula or extended field) and if the type change makes dependencies invalid or not.

Delete formula

To delete a document formula, click on the "menu" icon next to the formula and select "Delete".

Beware that formula are deleted permanently and you will need to recreate them manually to get them back up.
If a document formula is used in others items configuration (filters, calculation fields, others formulas), then it cannot be directly deleted. In order to delete the formula you will need to delete all children occurences. 

Display formula's result within your document.

You can drag and drop a formula from the "Document formulas" tab to add the formula's result to your document or click on the icon menu and select "Display in document".

Did this answer your question?