Adding a Computed Item in Query

In the Query section, a computed item is a set of instructions to the database server. EPM Workspace uses the computing power of the database server to perform calculations as it retrieves data from the database.

For this reason, the Query section allows you to use computed items in a way that is not possible in the other sections. Instead of creating a new data item, the new values simply replace the original values in the data item as they are retrieved from the database.

Additionally, you can compute items using any topic item in the data model and any scalar functions provided by your RDBMS.

Note:

You are unable to add computed items through shortcut menu in EPM Workspace. At least one Results or Table column must be present to enable the right-click (shortcut) menu which contains the option to add or modify a computed item. When no columns are present, select the menu option Actions, and then Add Computed Item to create a computed item.

  To create a computed item in the Query section:

  1. Select an item in the Request pane and choose Actions, and then Computed Item.

    The Computed Item dialog box is displayed.

    Optional: You can also select a request item and choose Add Computed Item on the shortcut menu. At least one Results or Table column must be present to enable the shortcut menu which contains the option to add or modify a computed item. When no columns are present, you must select the Add Computed Item from the Actions menu.

  2. Enter a name for the computed item in the Name field.

    The default name is Computed, which is numbered sequentially if there is more than one computed item. If you assign a name to a computed item that is identical to an existing scalar function name, EPM Workspace numbers the name starting with the number 2.

  3. Select the data type of the computed item to build from the Data Type list box.

    See also Adjusting Data Types.

  4. Enter the definition of the computed item in the Definition text box.

    • See Operators.

    • Click Reference to display the Reference dialog box, and select items to place in the equation. See also Reference.

      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 (‘_’).

  5. When the equation is complete, click OK.

    In the Query section, the computed item is displayed on the Request pane with its new name. When the query is refreshed, the computed item is listed in the Results Data Layout pane, and it is displayed as a column in the results set.