How to Insert a Custom Expression


TIBCO Spotfire supports two different types of expressions: Insert Calculated Column, which creates a new column in the data table, and Custom Expression, which is used to dynamically modify the expression used on an axis or to define a setting. Both types of expressions are created with a similar user interface, but custom expressions can also be typed directly into the column selector.

Tip: For simple expressions it is often faster to type expressions directly in the expanded column selector. If the expression is longer and involves lots of properties and functions, the Custom Expression dialog can provide more help, as described below.

  1. Right-click on a column selector on an axis, in a Visualization Properties dialog, or in the Legend, to display the pop-up menu.

  2. Comment: You can also create custom expressions for rules and reference lines, etc. See Custom Expressions for Coloring,Details on Custom Expression for Subset, Details on Limit Data Using Expression, Details on Horizontal/Vertical Line, Details on Curve Draw, or Details on Curve from Data Table for more information.

  3. Select Custom Expression....

  4. Response: The Custom Expression dialog is displayed.

  5. Specify a suitable expression by either typing it directly into the Expression text field, or by selecting columns, properties and functions from the list and clicking the corresponding Insert button.
    An example of an expression could be: [Exports m$]/[Population].

    Comment: You can always modify the expression by editing the text in the Expression field using cut-and-paste, or by typing text. For a detailed description of the expression language, see General Syntax and other topics under Expression Language in the Insert Calculated Column chapter. For details on the syntax to use when adding properties, see Properties in Expressions.

  6. Type a Display name for the expression.

  7. Click OK.

    Comment: If an error message is shown, there is a problem with the expression. Go back and modify the expression until the desired result is achieved.

    Response: The expression is used on the specified axis or setting.

Tip: If you have previously created a suitable expression, you may select it from the Recent expressions list and click the Insert button.

  1. Select Insert > Calculated Column....

    Comment: See How to Insert a Calculated Column for more information.

See also:

Custom Expressions Introduction

Custom Expressions Overview

Basic Custom Expressions

OVER in Custom Expressions

Advanced Custom Expressions

Details on Custom Expression

What is a Calculated Column?