Class

SpotfireDataTransformation

SpotfireDataTransformation(dataTableName, type, transformationDescription)

Constructor

new SpotfireDataTransformation(dataTableName, type, transformationDescription)

Describe transformation to apply on a data table.

Parameters:
Name Type Description
dataTableName String

The name of the data table.

type SpotfireTransformationType

The type of the transformation.

transformationDescription Object

The description of the transformation to be added.

Methods

setAddCalculatedColumn(transformationDescription)

Set the description of an add calculated column transformation.

Parameters:
Name Type Description
transformationDescription AddCalculatedColumnTransformation

The description of the add calculated column transformation to be added.

column String

The name of the column to add. Can be null or empty, in which case the expression is used as name.

expression String

The expression that defines the column.

setChangeDataType(transformationDescription)

Set the description of a change data type transformation.

Parameters:
Name Type Description
transformationDescription ChangeDataTypeTransformation

The description of the change data type transformation to be added.

columns Array.<String>

Names of the columns that should change DataType.

type SpotfireDataTypes

The DataType to change to.

setDataFunction(transformationDescription)

Set the description of a data function transformation.

Parameters:
Name Type Description
transformationDescription DataFunctionTransformation

The description of the data function transformation to be added.

path String

Library path of the registered data function.

setExcludeColumns(transformationDescription)

Set the description of an exclude columns transformation.

Parameters:
Name Type Description
transformationDescription ExcludeColumnsTransformation

The description of the exclude columns transformation to be added.

columns Array.<String>

Names of the columns to exclude.

setFilterRows(transformationDescription)

Set the description of a filter rows transformation.

Parameters:
Name Type Description
transformationDescription FilterRowsTransformation

The description of the filter rows transformation to be added.

expression String

Expression that defines the columns to filter.

setPivot(transformationDescription)

Set the description of a pivot transformation.

Parameters:
Name Type Description
transformationDescription PivotTransformation

The description of the pivot transformation to be added.

identityColumns Array.<String>

Names of columns to pass through to identify each row of the result data.

categoryColumns Array.<String>

Names of columns whose values are used for grouping data into result columns.

valueColumns Array.<Object>

Each value column data is aggregated over identity columns and category columns and stored into the result data columns.

[].name String

Name of a column to use as value column.

[].aggregation String

Aggregation method to use for a value column.

transferColumns Array.<Object>

TransferColumns are aggregated over the identity columns and stored into result transfer columns.

[].name String

Name of a column to use as transfer column.

[].aggregation String

Aggregation method to use for a transfer column.

resultNamingExpression String

Naming expression for the aggregated result data columns. This naming expression is a string containing a placeholder to be replaced with values during Pivot as follows: %M is replaced with the aggregation method name (empty string for None). %V is replaced with the value column name. %C is replaced with a concatenated list of category values separated by Category separator.

transferNamingExpression String

Naming expression for the aggregated transfer result columns. This naming expression is a string containing a placeholder to be replaced with values during Pivot as follows: %A is replaced with the aggregation method name (empty string for None). %T is replaced with the transfer value column name.

setRenameColumns(transformationDescription)

Set the description of a change name transformation.

Parameters:
Name Type Description
transformationDescription RenameColumnsTransformation

The description of the change name transformation to be added.

columns Array.<String>

Names of the columns to rename.

expression String

Expression that defines the new name of the columns.

setReplaceColumn(transformationDescription)

Set the description of a replace column transformation.

Parameters:
Name Type Description
transformationDescription ReplaceColumnTransformation

The description of the replace column transformation to be added.

column String

Name of the column to replace.

resultName String

The name of the resulting column. Can be null or empty, in which case the original column name is kept.

expression String

The expression to use.

setReplaceSpecificValue(transformationDescription)

Set the description of a replace specific value transformation.

Parameters:
Name Type Description
transformationDescription ReplaceSpecificValueTransformation

The description of the replace specific value transformation to be added.

column String

Name of the column to be changed.

oldValue Object

The value to be replaced in the column.

newValue Object

The new value.

rowIdentifiers Array.<Object>

Row identifying columns.

[].column String

Name of column used to define the rows which contain the values to be replaced.

[].value Object

The value identifying the rows for the row identifying column.

warn Boolean

A value indicating whether a warning should be shown when the transformation replaces more than one value.

setReplaceValues(transformationDescription)

Set the description of a replace values transformation.

Parameters:
Name Type Description
transformationDescription ReplaceValuesTransformation

The description of the replace values transformation to be added.

column String

Name of the column to be changed.

oldValue Object

The value to be replaced in the column.

newValue Object

The new value.

setUnpivot(transformationDescription)

Set the description of an unpivot transformation.

Parameters:
Name Type Description
transformationDescription UnpivotTransformation

The description of the unpivot transformation to be added.

identityColumns Array.<String>

Names of columns to pass through and repeat for each unpivoted value.

valueColumns Array.<String>

Names of columns whose data is merged into one result column of data. Column names are merged into a category column.

categoryColumn Object

Column containing merged column names

name String

Name of the category column for merged column names.

type SpotfireDataTypes

DataType of the category column.

resultColumn Object

Column containing merged values.

name String

Name of the result column holding the merged value column data.

type SpotfireDataTypes

DataType of the result column.