Designing reports using BIRT Studio : Inserting calculated data : Creating a computed column : About expressions : How to create a computed column
 
How to create a computed column
1 Select the column to the left of the new computed column you want to insert.
2 On the toolbar, choose New Computed Column, as shown in Figure 3‑3.
Figure 3‑3 Choosing New Computed Column
3 In Calculation, type a name in Column Label for the computed column. The name you specify appears in the column header.
4 In Enter Expression, type the expression to calculate the values you want to display:
*To use a data field in the expression, type the left bracket ([), then select a field from the list that appears, as shown in Figure 3‑4.
Figure 3‑4 Selecting a data field to use in an expression
The list shows only the fields in use in the report design. It does not show all the fields in the data set. To use a field that is not in the list, you must add the field to the report design.
*To use a function, type the first letter of the function, then select a function from the list that appears, as shown in Figure 3‑5. The functions indicate the arguments, if any, you need to supply.
Figure 3‑5 Selecting a function to use in an expression
5 When you finish building the expression, choose Validate. If the expression is syntactically correct, the message, The Expression is valid appears. If the expression contains an error, a message that describes the error appears.
6 After you validate the expression, choose OK. The computed column appears in the report design.
A computed column containing data of numeric or date‑and‑time type needs to be formatted. For example, the Total column in the example above should be formatted as currency.