Working with Formulas

In the process of drawing a database plan and later during TeamDesk database setup and its fine-tuning, you will most probably come across the need to create something more complex than a simple column that stores user-generated entries. With TeamDesk you may have the system calculate or generate data entries automatically basing on formulas that you create in formula-columns and in the default/calculate option of simple physical columns. Moreover, there is the Custom Formula option in filters of views, buttons, triggers, documents, dashboards, reminders and notifications.

Formulas may be used for simple cases as when you need to sum two numeric values, or for more complicated calculations. Formula in TeamDesk is a type of a rule used to calculate a certain result that may be stored as a column value or used in some other way (for example, a row colorization formula is used to define conditions when rows in the table should be highlighted).

Example 1

“Address” Formula-Text column: List("\n", List(" ",[Street],[Building]), [City], [State], [Zip Code], "USA")

“Duration” Formula-Duration column: [End Time]-[Start Time]

“ISO Week Number” Formula-Number column: ISOWeek([Date])

You can see the formula columns with calculated results below:

Example 2

Custom Formula in Filter of Table View: Ask(Any([Language], Parameter([Language])))

The “Language” column is a Text column with the activated multi-choice Check Boxes option. As the result, if any Language selected in the filter is listed in interpreter profile record, such a record is included into the view.

Example 3

Colorization formula in Chart View: Case([Product], "Cacao", "#6633FF", "Coffee", "#FFCC00", "Tea", "#33CC00")

As the result, the chart is colored according to the specified colors.

Next: Formula Building Blocks