Creating Expressions

The Expression tab of the Easy Reporter window allows you to add expressions as items on your reports or charts. Expressions are calculations based on the data. The Expression tab is shown below.

 

   Figure 230: Easy Reporter Window Expression Tab

Introduction to Expressions

There are three basic building blocks for expressions:

•   Functions

•   Mathematical Operators and Symbols

•   Literal Values

Functions

Functions are stored in the Functions folder in the Function: field. There are two basic categories of expression functions—those that return a single value for each row of data in the table, and those that summarize data by grouping rows of similar data together.

When you use a function that summarizes rows into groups, Easy Reporter automatically groups the data correctly.

 

   Note:


    This manual does not describe each of the SQL functions. Consult an SQL manual for descriptions of the functions listed.


Mathematical Operators and Symbols

Mathematical operator and symbols are stored in the Operators/Symbols folder in the Function: field. Operator options include: +, =, <>.

Literal Values

Literal values are exact values you enter. They can be numbers or character strings. They are stored in the Literal values folder in the Function: field.

Creating an Expression

To create an expression:

1.   Click the Expression tab of the Easy Reporter window.

2.   Enter a name for the expression in the Expression name field.

3.   Choose the appropriate data type from the Data type drop-down list. The available options are:

•   Number

•   Character String

•   Date

4.   Build the expression from left to right by adding functions, items, operators, and literal values to the Expression: field (as described below) until the expression is complete.

5.   If you make a mistake, you may remove an item from the Expression: field by right-clicking the item and selecting Delete from the pop up menu.

6.   Click Save to save the expression.

Saved expressions are stored in the Expression folder folder in the Select Folder and Items: field. To view an expression, select it in the Expression folder folder, and click the Expression tab. You can edit an expression in the same way you create it.

 

   Note:


    Easy Reporter does not check the validity of the expressions you create.


Adding Functions to Expressions

To add a function to an expression:

1.   Open the Functions folder in the Function: field by clicking the plus icon next to a folder or item name.

2.   Click and drag the function from the Function: field into the Expression: field.

3.   Click and drag the appropriate item to evaluate from the Select Folder and Items: field into the Expression: field.

4.   If the function takes more than one item, separate the items with a comma. To do this, click and drag the Comma [,] from the Operators/Symbols folder in the Function: field into the Expression: field.

5.   To close the parentheses, click and drag the Close Parenthesis [)] from the Operators folder in the Function: field into the Expression: field.

Adding Operators to Expressions

To add an operator to an expression:

1.   Open the Operators/Symbols folder in the Function: field by clicking the plus icon next to a folder name.

2.   Double-click the operator in the Function: field or click and drag the operator from the Function: field into the Expression: field.

Adding Literal Values to Expressions

To add a literal value to an expression:

1.   Open the Literal values folder in the Function: field by clicking the plus icon next to a folder name.

2.   Select the appropriate value type: Number, Character string, or Date.

3.   Click and drag the value type from the Function: field into the Expression: field.

4.   A blank box is displayed in the Expression: field. Type the literal value into the box, then press Enter.

If you make a mistake, right-click the box and select Modify from the pop-up menu.

You can also press the Esc key to restore the original value.

Adding Expressions to Reports and Charts

You may add expressions to reports and charts in the same way you add regular items.

To add an expression to a report or chart:

1.   Click the Layout tab.

2.   Select the expression from the Expression folder in the Select Folder and Items: field.

3.   Click and drag the expression from the Select Folder and Items: field onto the horizontal axis, vertical axis, or measures area in the Selected Items: field.

Deleting Expressions

To delete an expression:

1.   Select the expression you wish to delete from the Expression folder folder in the Select Folder and Items: field.

2.   Press the Delete key on your keyboard.