Release 10.1A: OpenEdge Reporting:
Query/Results for UNIX

> ## Adding a math expression

> This section explains how to add a math expression to determine the cost for each order line in a customer’s order. To do this, you define the math expression to multiply the number of units in each order line by the cost for each unit.

> | To add a math expression to determine the cost for each order line in a customer’s order:

> 1. Select Define.

> Since you have already defined files you plan to work with, the screen displays a list of options you can choose from to expand your report:

> 2. Select Math Expressions. Results displays a list of operations:

> You can select any of these operations to create your math expression.

> 3. Select Multiply. A window opens that lists all the numeric fields in the active files:

> Results prompts you to enter the first multiplier in your math expression. In this tutorial, you multiply the number of units on hand by the cost for each unit.

> 4. Select the Qty field.

> The list of numeric fields you can pick appears again. The expression begins to build in the Expression window and Results prompts you to choose the next multiplier:

> 5. Select the Price from Item database field.

> The Price field appears in the Expression window and Results prompts you to continue adding to this expression:

> If you select Yes, you can continue to add to the expression using any of the math operations (Add, Subtract, Multiply, Divide, or Raise to a Power) and Results automatically groups them with parentheses. In this tutorial, you will multiply these two selected fields.

> 6. Select No.

> The screen clears to the Report layout window and another window, Formats and Labels, appears. Here you can redefine the default label and format information for the new numeric field created by the Math Expression:

> The Report Info. window contains the following:

> - File — Displays as Numeric Expr, because it is a generated field (not contained in any database file).
> - Field — Displays the name which Results automatically assigns to the field you are creating. This field name will be in the list with the other field names once you add the new field.
> - Expression — Displays the math expression you just built. In this case, an ellipse
>   (. . .) shows that Results truncated the expression to fit it in the window.
> - Type — Displays the data type of the field. In this case, the data is in decimal format.
> - Label — Displays the default text that appears above the column in the report. In this case it is Math Value. You can change this to a more descriptive name for your report.
> - Format — Shows the default display format. In this case, the format is ->>>>>>>9.99.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095