Creating Calculated Data Items

About Calculated Data Items

SAS Visual Analytics Explorer enables you to calculate new data items from your existing data items by using an expression. For example, you might want to calculate a company’s profits by subtracting expenses from revenues.
Note: All calculations are performed on unaggregated data. The calculated expression is evaluated for each row in the data source.
In addition to performing mathematical calculations on numeric values, you can use calculated items to create date and time values. For example, if your data contains separate categories for month, day, and year, then you can calculate a date value from those categories.

Create a Calculated Data Item

To create a calculated data item:
  1. Select Datathen selectNew Calculated Item.
    The New Calculated Item window appears.
    The New Calculated Item Window
    The New Calculated Item window
  2. Enter a Name for the calculated data item.
  3. Select the data type for the calculated item from the Result type drop-down list.
  4. Build the expression for your calculated data item by dragging data items and operators onto the expression in the right pane. For each field in the expression, you can insert a data item, an operator, or a specific value.
    Note: Derived data items are not supported for calculation expressions.
    When you drag items or operators onto your expression, the precise location of the cursor determines where and how the new element is added to the expression. As you drag the new element over the expression, a preview appears, which displays how the expression would be changed if you drop the element at that location.
    For example, if your current expression is ( Profit / Revenue ), and you drag the x - y (Minus) operator over the left parenthesis symbol, then the expression changes to ( [number] — ( Profit / Revenue )). If you drag the operator over the division symbol, then the then expression changes to ( Profit — Revenue ), and so on.
    There are a large number of operator types available to perform mathematical functions, process datetime values, and evaluate logical processing such as “if” clauses. See Operators for Calculated Data Items.
  5. When you have finished creating your expression, select the Default aggregation type for the calculated item and then click Select to choose the data format.
  6. Click Preview to see a preview of the calculated data item as a table. The table displays the values of the calculated item as well as any data items that are part of the calculation expression.
  7. Click OK to create the new calculated data item. The new data item appears in the Data Items pane.