Creating a column by defining expressions with Prompted Query
You can create a column in your report by defining an expression. An expression adds, subtracts, multiplies, or divides the values in two or more columns and places the results in a new column.
About this task
In this example, you create a total earnings column that is the sum of each employee's salary and commission.
To create a column by using expressions:
- Select the table, either by typing the name on the Tables panel or by selecting the table from the Table List.
- Select the columns from the Columns panel by typing any character beside each one.
- At the bottom of the Columns panel, select choice 1, Expression (A+B, etc.).
- Press Enter. The Expression panel displays, which is shown in the following figure.
- Enter your expression. For example, enter:
SALARY + COMM
You can also create more complex expressions. For more information, press the Help function key on the Expressions panel. You can also press the List function key to see columns that you can use in your expression.
The names of the tables and columns you selected are displayed in the echo area. The new column that you created is also displayed under the heading Columns. The Specify panel displays again with choice 3, Row Conditions, selected, as shown in the following figure: