Using Variables in Formulas

After you add a variable, you can use it in formulas for various system objects (columns, tables, views, etc.). It is important to remember that all variable values are treated by the system as simple text. Therefore, you cannot simply input variables into formulas that deal with numbers or dates.

When creating formulas with a variable, you will need to convert the variable into the corresponding format. Variables are inserted into formulas in square brackets (for example, Var[hourly rate]). To convert a variable into the necessary format, use the Type Conversion functions ToXXX(Var[variable]), for example:

When you create a formula, there may be a situation where a variable and a column have the same name. References to column values and variables are given in formulas in the same way - in square brackets (for example, Var[project start date]). If the names of the column and the variable coincide, the formula will use the column value.

The following table contains examples of converting variables into different formats and using variables in formulas:

Variable Name Value Format to Conversion Function Formula Example, Description
hourly rate 15.00 Numeric ToNumber(Var[hourly rate]) ToNumber(Var[hourly rate])*8 - The formula calculates the amount earned per 8 hours of a normal workday.
start date 01-01-2006 Date ToDate(Var[start date]) Today() - ToDate(Var[start date]) - The formula calculates how many days have passed since the project start date.