Create Column
The Create Column transformation is used to create a new column in a dataset based on existing column(s) and a specified function or formula. This transformation is useful when you need to perform calculations or data manipulations on existing columns and store the results in a new column.
Parameters
- Source Column(s): Select one or more columns that you want to use as input for the function or formula. This is a required field.
- Destination Column: Enter the new name for the column that will hold the results of the function or formula. This is a required field.
- Function or Formula: Define the function or formula to apply to the source column(s). This is a required field.
Usage
To use the Create Column transformation in Mantium, follow these steps:
- Select the transformation from the list of available transformations in the Mantium user interface.
- Configure the Source Column(s) parameter by selecting the column(s) that you want to use as input for the function or formula.
- Configure the Destination Column parameter by specifying the new name for the column that will hold the results of the function or formula.
- Configure the Function or Formula parameter by defining the function or formula to apply to the source column(s).
- Run the transformation by clicking the Run button. The resulting dataset will have a new column with the specified name containing the results of the function or formula applied to the source column(s).
Example 1
Suppose you have a dataset containing product sales data, and you want to calculate the total sales value for each product by multiplying the quantity sold by the price.
Sample Dataset:
Product | Quantity | Price |
---|---|---|
A | 10 | 50 |
B | 15 | 30 |
Config:
Source Column(s): [Quantity, Price]
Destination Column: Total Sales
Function or Formula: "Quantity * Price"
Expected Result Dataset:
Product | Quantity | Price | Total Sales |
---|---|---|---|
A | 10 | 50 | 500 |
B | 15 | 30 | 450 |
Example 2
Suppose you have a dataset containing temperature data in Fahrenheit and you want to convert the temperature to Celsius.
Sample Dataset:
City | Temperature (F) |
---|---|
New York | 68 |
Los Angeles | 75 |
Config:
Source Column(s): [Temperature (F)]
Destination Column: Temperature (C)
Function or Formula: "(Temperature (F) - 32) * 5/9"
Expected Result Dataset:
Updated 2 months ago