You can use computed fields in any band of the DataWindow object.
You can enter any valid DataWindow expression when defining a computed field. You can paste operators, columns, and DataWindow expression functions into the expression in the Modify Expression dialog box. Use the + operator to concatenate strings.
You can use any built-in or user-defined global function in an expression. You cannot use object-level functions.
To display | Enter | In this band |
---|---|---|
Current date at top of each page | Today() | Header |
Current time at top of each page | Now() | Header |
Current page at bottom of each page | Page() | Footer |
Total page count at bottom of each page | PageCount() | Footer |
Concatenation of Fname and Lname columns for each row | Fname + " " + Lname | Detail |
Monthly salary if Salary column contains annual salary | Salary / 12 | Detail |
Four asterisks if the value of the Salary column is greater than $50,000 | IF(Salary > 50000, "****", "") | Detail |
Average salary of all retrieved rows | Avg(Salary) | Summary |
Number of retrieved rows, assuming each row contains a value for EmpID | Count(EmpID) | Summary |
You can refer to other rows in a computed field. This is particularly useful in N-Up DataWindow objects when you want to refer to another row in the detail band. Use this syntax:
ColumnName[x]
where x is an integer. 0 refers to the current row (or first row in the detail band), 1 refers to the next row, -1 refers to the previous row, and so on.
For complete information about the functions you can use in computed fields in the DataWindow painter, see the DataWindow Reference.