You can rank and provide statistics for the values represented in the totals or subtotals. The Add Computed Item feature enables you to build equations to compute totals, or to apply functions to values. Computed items are like normal data items and can be included in reports or reused to compute other data. For example, you can modify an Amount Sold item by building an equation around it, multiplying by a Unit Price item, and renaming the resulting item Revenue. You can apply a scalar function such as Cume to Amount Sold and return each individual value as a cumulative running total, or simply multiply Amount Sold by the local tax rate to find the tax owed on each sale.
The Computed Item dialog box is used to build a computed item expression. The computed item expression is a value, variable, logic statement, or equation that instructs Interactive Reporting how to perform a computation.
To create a computed item:
In the Name field, type a name that describes the computation.
The default name is Computed, which is numbered sequentially if there is more than one. If you assign a name to a computed item that is identical to a scalar function name, Interactive Reporting numbers the name starting with the number 2.
Define the new data item by building an expression in the Definition text box.
Use the operator buttons to insert arithmetic and logical operators at the insertion point.
You can also type any portion of the equation or the entire equation directly into the Definition text box using JavaScript. The names are case sensitive, and you must replace spaces in item names with underscores (‘_’).
If necessary, click Options to set a new data type for the item.
When the equation is complete, click OK.
The computed item is added to the data layout and it is displayed as a table column.
Tip: | To retrieve the top five records in a table, first add a computed item on the results section to rank the records The computed item would be Rank (Sorted_Column ), where the Sorted_Column would be sorted in descending order. Next, create a new table section and add the columns of data. Add a filter on the computed item column in the Table section and set it to < 6. |
Note: | Add a computed item on the results section to rank the records. Such a computed item should be Rank ( Sorted_Column ), where the Sorted_Column would be sorted in descending order. Next, create a new table section and add the columns of data. Add a limit on the computed item column in the Table section and set it to < 6. |