In a calculated column, is there a way to combine OVER with a custom TERR function?

In a calculated column, is there a way to combine OVER with a custom TERR function?

book

Article ID: KB0080348

calendar_today

Updated On:

Products Versions
Spotfire Analyst 7.7 and later

Description

In a calculated column, is there a way to combine OVER with a custom TERR function?

Issue/Introduction

In a calculated column, is there a way to combine OVER with a custom TERR function?

Environment

All supported environments

Resolution

Yes.  In Spotfire 7.7 and later, the family of TERRAggregation_*() functions can be used to combine calls to TERR functions with the OVER structure, as in the following example:

     TERRAggregation_Real("output <- max(diff(sort(input1)))",[Mileage]) OVER ([Type])

The above example is demonstrated in the Spotfire analysis in the attached file. (Filename: FuelFrame--TERRAggregate calc column.dxp).  It creates the [MaxDiffSortMileageOverType] calculated column in the file's "FuelFrame" data table.

These are the functions in the TERRAggregation_*() family of functions:

     TERRAggregation_Binary
     TERRAggregation_Boolean
     TERRAggregation_DateTime
     TERRAggregation_Integer
     TERRAggregation_Real
     TERRAggregation_String
     TERRAggregation_TimeSpan

Each function's name includes the Spotfire data type of the result it returns.

The dialog that is opened by selecting “Insert > Calculated Column…” from the Spotfire 7.7 desktop client’s main menu provides the following brief introduction to these TERRAggregation_*() functions, along with examples of the syntax used in calling them.

-----
Calls the TIBCO Enterprise Runtime for R engine and returns an output of the specified data type. The first argument is a script and the following arguments are the arguments to the script.

The script should return a single aggregated value. At least one argument other than the script is required.

The inputs will be placed in variables called input1, input2, ... inputN, and the output must be placed in a variable called output.

Examples:
   TERRAggregation_Real("output <- median(input1) + median(input2)", [X], [Y])
   TERRAggregation_String("output <- input1[1]", [Customer Name])
-----

Attachments

In a calculated column, is there a way to combine OVER with a custom TERR function? get_app