Modify Expression dialog box
Description
To modify any DataWindow expression, set the insertion point
in the Expression box and insert functions, columns, and operators.
You can also type part or all of the expression in the Expression
box.
To refer to the value of a column in a specific row, enter:
columnname [integer]
where columnname is the name of the column
and integer is one of these:
-
0 to indicate the current row
-
A negative integer to indicate a previous row. For
example, -5 would be the fifth row before the current row. -
An integer to indicate a successive row. For example,
5 would be the fifth row after the current row. (Do not use a plus
sign (+).)
Options
Operators
Select an operator to paste it into the expression at the
cursor.
Functions
Select a function to paste it into the expression. The argument
is selected so that you can replace it with a column name.
Columns
Select a column to paste it into the expression at the cursor.
Verify
Click to verify the expression without saving it.
Example
This expression (on a single line) displays the average salary
for the group unless the average salary for the group is over $50,000
in which case it displays the average salary for the group and the
company:
1 |
if( avg( emp_salary for group 1 )>50000, "Co average $ " + string(avg(emp_salary)) + " Group average $ "+ string(avg( emp_salary for group 1)),"Group average $ "+ string(avg( emp_salary for group 1))) |
This statement dynamically displays a happy face bitmap image
in a computed field if the salary column is greater than 40,000
and a sad face if it is not:
1 |
Bitmap(If(emp_salary>40000, "happy.bmp", "sad.bmp")) |