Calculated Fields

Calculated fields allow you to manipulate existing fields by arithmetic operations on numbers and dates, or extraction of portions of dates and times.

The following calculated field types are available:

Calculated Date

Use a Calculated Date field to derive a new date, produced by calculation from another date field of the same entity or the current date and time.

The result is always a pure date. That is, any portion of a day is discarded from the starting field if it had a non-zero time component, and all calculations can only add or subtract whole days. This allows simple comparison with other dates.

For example, given a field containing the date of birth, you can calculate the current age of a person or, given the age, calculate the approximate year of birth. To calculate age, connect to your database in iBase Designer, and select the Person entity type. The list of fields includes a field called Date of Birth. You can create a new calculated field called Age, and set its formula to be the current date minus the Date of Birth. The result will be the age in days, which you can then divide by 365.25 to get the age in years.

The configuration you must enter is:

  • Base Field: <Current Date/Time>

  • Operation 1: - (minus) Date of Birth

  • Operation 2: / (divided by) value = 365.25

  • Operation 3: - (minus) value = 0.5

  • Round the result: Yes

  • Decimal place(s): 0

Calculated fields also help in identifying records for purging, based on dates of data entry or changes of status of the represented entities and links.

Calculated Date Part

Use a Calculated Date Part field to derive a part of a date or time, selected from another date field of the same entity or from the current date and time. For example, given a date you can display just the day, month, or year.

Calculated Number

Use a Calculated Number field to derive a number from another numeric or date field or the current date and time.

The permitted operations are addition, subtraction, multiplication and division, shown in the drop-down list as +, -, *, and / .

You can mix fields of type Real Number, Counting Number, Currency, Date, and Time (but not Time Zone) with fixed values, both real numbers and integers.

You cannot affect the order of calculation by using brackets.