Spotfire® User Guide

Adding a calculated column

Calculated columns allow you to combine or recalculate one or more columns with aggregation measures and/or mathematical expressions. This way, you can create new columns with more information based on your available data. They can be added from the menu or from the Data canvas.

About this task

For generic information about Spotfire expressions, see Making your own calculations and Expression language details.
Tip: You can also add a calculated column to a data table from the Data canvas, by clicking the plus sign on the final data table node, and selecting Add calculated column.

Procedure

  1. On the menu bar, click Data > Add calculated column.
  2. In the Add calculated column dialog, type the expression of interest.
    For more information about which types of methods you can use, see Functions and Operators. You can also add more advanced expressions using different types of properties.
    Tip: When you start typing, autocomplete functionality will suggest names of functions or column names, matching those characters you have written. Click a suggestion, and it will be added to the expression.
    Tip: When using the installed client, you can (in many cases) get access to a sample result directly in the dialog, or click Preview to see sample results. Note that if aggregating functions (such as, "Count") are used in the expression, only the first 100 rows will be used in the sample calculation.
  3. Beneath Column name, give the added column a proper name.
  4. Click OK.

Results

The expression is evaluated for each row in the data table and a new column is created. If the Filters panel is shown, a new filter will also show up (if you are working with in-memory data).