Add New Column
Through the Transformer page, you can create a new column of data, containing constant values, references to other columns or metadata, or functions that you specify. Some transformations also create new columns of data.
Adding a new column can insert any of the following types of data into your dataset:
Constant or literal values. Example formulas:
"clean"
5
Note
When a new column of data is inserted, the Trifacta Application attempts to infer the data type of the values in the column. In the above examples, the inferred data types would be String and Integer, respectively.
References to another column. You can create a new column of data that contains a reference to another column, which effectively copies and pastes the column values into the new column. In the Formula, you type the name of the source column.
For columns containing numeric data types, you can create a new column by applying a formula to combine the data. You can apply formulas like:
column1 + column2
To round the above computation to two decimal places, use the following:
round(column1 + column2,2)
Metadata about your dataset. You can insert references to metadata about your source dataset. For more information on adding metadata, see Insert Metadata.
Functions. Your new column can contain the results of a function calculations. Example formulas:
1+2+3
stdev(circumferenceCM)
Combinations. Constants, literals, and functions can be combined into a single formula. Example:
multiply(add(1,sales_tax_rate),sales_pre_tax)
Note
As indicated in the above example, functions can be nested inside of each other.
Add New Data
You can add in new data to your dataset through the following methods.
New columns
Create new columns in your dataset containing literal values, function outputs, or values from other columns, including extraction of values into new columns.
Steps:
In the Transformer page, click the Recipe icon. The Recipe Panel is displayed.
In the Recipe panel, click New Step.
To add a recipe step, enter
New Formula
. This transformation adds a new column of data.In the New Formula panel, enter the required details:
Formula type: Type of formula in the transformation.
Single row formula: Formula calculations are contained within a single row of values.
Multiple row formula: Formula calculations involve multiple rows of inputs. In this formula type, you can sort and group the rows.
Formula: The formula you want to enter to create a new column. See above for examples.
New column name: The name of the new column.
To create a new column, click Add. A new column is created.
Metadata
You can insert references to metadata about your datasources within your dataset. Source row and path information can be added as new data.
For more information, see Insert Metadata.