Class

SpotfireDataTransformation

SpotfireDataTransformation(dataTableName, type, transformationDescription)

Describe transformation to apply on a data table.

Constructor

new SpotfireDataTransformation(dataTableName, type, transformationDescription)

Parameters:
Name Type Description
dataTableName String

The name of the data table.

type SpotfireDataTransformationTypes

The type of the transformation.

replaceColumn String

Transformation used to replace an existing column with a calculated column.
See setReplaceColumn. Other accepted value: 'Calculate and replace column'.

addCalculatedColumn String

Transformation used to create a new calculated column.
See setAddCalculatedColumn. Other accepted value: 'Calculate new column'.

renameColumns String

Transformation used to change the name of a set of columns according to an expression.
See setRenameColumns. Other accepted value: 'Change column names'.

changeDataType String

Transformation used to change the DataType of one or more columns.
See setChangeDataType. Other accepted value: 'Change data types'.

dataFunction String

Transformation using a previously registered data function.
See setDataFunction. Other accepted value: 'Data function'.

excludeColumns String

Transformation used to exclude a set of columns.
See setExcludeColumns. Other accepted value: 'Exclude columns'.

filterRows String

Transformation used to only keep the rows that match a given expression.
See setFilterRows. Other accepted value: 'Filter rows'.

pivot String

Transformation used to pivot tall-skinny data into short-wide data.
See setPivot. Other accepted value: 'Pivot'.

replaceSpecificValue String

Transformation used to replace values on specific rows, or on a single specific row.
See setReplaceSpecificValue. Other accepted value: 'Replace specific value'.

replaceValues String

Transformation used to replace all values in a column that match a given value.
See setReplaceValues. Other accepted value: 'Replace value'.

unpivot String

Transformation used to unpivot short-wide data into tall-skinny data.
See setUnpivot. Other accepted value: 'Unpivot'.

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 TransformationColumn

Column containing merged column names

name String

Name of the column for merged column names.

type SpotfireDataTypes

DataType of the column. From enum SpotfireDataTypes

name String

Name of the category column for merged column names.

type SpotfireDataTypes

DataType of the category column.

resultColumn TransformationColumn

Column containing merged values.

name String

Name of the column for merged column names.

type SpotfireDataTypes

DataType of the column. From enum SpotfireDataTypes

name String

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

type SpotfireDataTypes

DataType of the result column.