Formula attributes

User-defined attributes of the formula type largely differ from other user-defined attributes. They are not used to save data (they do not belong to the input attributes), but consist of an arithmetic expression that contains other attributes. This expression is created when you create the attribute, but can be changed later on.

The advantage of using formula attributes is that Visum automatically recalculates the formula when one of the input values changes. Then your values are always up-to-date. Just as the other attributes, you can also use formula attributes to graphically display data, filter data or to perform analyses.

Example

For a PrT and PuT assignment, Visum calculates link volumes for PrT and PuT that are saved to the attributes volume PrT [Pers] and volume PuT [Pers]. When creating a formula attribute

Advantage PrT = Volume PrT [Pers] - Volume PuT [Pers]

you have direct access to the difference between the two volumes. This difference is automatically updated if one of the input values changes.

Formula attributes are always numerical. When creating a formula expression, you have the same options as for the procedure Edit attribute (User Manual: Editing attribute values during a procedure sequence): A formula is the sum of (a number of) subexpressions that each consist of attributes combined with a binary operator or a function. The operators and functions available include the four basic arithmetic operations, division in percent, raise to power, minimum and maximum. Each subexpression can be included, rounded, or truncated.

There are no restrictions concerning the attributes you can use in a formula. You can use formula attributes within other formula attributes to form more complex expressions. You can also use brackets.

Example
  • Links formula attribute Detour = [LENGTH]-[LENGTHDIR]
  • Links formula attribute Detour percentage = Percent([DETOUR],[LENGTHDIR])

Notes: Make sure that your formula does not contain a direct or indirect circular reference. You should also avoid references between output values and input values of the same procedure step in the procedure sequence because they can lead to undesired calculation results.

 

Note: In the directory C:\Users\Public\Documents\PTV Vision\PTV Visum 2021/Examples, you can find an example of use on this topic. The example Formulas shows the use of formula attributes, formula matrices, and aggregation functions in lists.