TERR_DateTime
In the Spotfire
Custom Expressions dialog box, you can select the pre-defined expression
TERR_DateTime
from the
Function list. This expression function invokes the TERR engine to return a vector or a single column data frame of the data type
POSIXct
or
POSIXlt
, which is converted to a Spotfire column of the corresponding Spotfire data type DateTime.
Argument | Argument description |
---|---|
A TERR script. | The TERR script contains the following.
|
Spotfire column names. | Passed as additional arguments, these are the data column names that
input1 to
inputN represent. All columns must be the same length.
|
Returned by TERR | Converted in Spotfire |
---|---|
A vector or a single column data frame of data type
POSIXct or
POSIXlt with the time zone as UTC. Any data specified as NA in
TERR maps to null in
Spotfire.
Do not use the
|
A column with the same number of rows as the input, and of the data type DateTime. |
TERR_DateTime
In this example, in Spotfire, create a column that has the current date and time, and then create a calculated column to truncate the seconds.
TERR_DateTime("output <- trunc(input1,'mins')",[DateTimeNow()])
The resulting table in Spotfire shows the following.
DateTimeNow()
is a built-in
Spotfire function.
max
, and Spotfire contains the function
Max
. ) You must overwrite this autocorrection manually to ensure that you use the TERR function case and name in your expression function.
See Embedding the contents of a script in an expression function for a detailed procedure for creating an expression function.