When defining new columns, the system uses formulas to specify the value to be displayed. The formula syntax used is quite common and should be familar to most users of spreadsheets and various other programs. Here are some examples of legal formulas:
a+10
a + (b-c)*(d/10)
a > b
(a < b) && (a > c)
'6/10/02' (a constant date)
The constants available are:
Numbers (e.g. 3.5, -2)
Text (e.g. "Yes", "Overtime")
Dates (e.g. '6/12/03' - note the single quotes)
The operators provided are:
Arithmetic: + (addition), - (subtraction), * (multiplication), / (division)
Relational: == (equals), != (not equals), > (greater than), >= (greater than or equal), < (less than), <= (less than or equal)
Logical: ! (negation), && (logical and), || (logical or)
Apart from these, one can use certain predefined functions in formulas.
Data types in formulas: The system has the following data types defined: Number, Date, Time period and Text.
The result of a formula depends on the data types of the variables in the formula. Consider the formula a + b . If a and b are numbers, the result is a number. If a and b are text (a text value is enclosed in quotes, e.g. "This is text") then the result is the concatenation of the two values. If a is a date and b is a time period, then the result is a date. In most cases common sense will give you the correct interpretation of the result of a formula.
In some cases, the data types of the variables may render a formula nonsensical. In these cases, the result is undefined. For example, if a and b are dates, a + b is undefined. Similarly if a and b are text values, a - b is undefined.
© 2006 Intellisys, Inc.