Copy Column Values
The Copy Column Values task copies values from a given column to a new Column.
When to use
- To create a backup of a column's values.
- To copy values from one column into another.
- To copy values from a column based on a criterion.
Quickstart
Let us start with the following sample data:
Student | Science | English | French |
---|---|---|---|
Alice | 140 | 138 | |
Bob | 135 | 145 | |
Frank | 122 | 102 | |
Judy | 185 | 135 |
In this sample data, it is evident that the student takes only one of the two language subjects. Our goal is to consolidate the values of English and French columns into a new column named Language
Student | Science | English | French | Language |
---|---|---|---|---|
Alice | 140 | 138 | 138 | |
Bob | 135 | 145 | 145 | |
Frank | 122 | 102 | 102 | |
Judy | 185 | 135 | 135 |
Following are the steps to achieve our goal:
- Go to Transform > Column Functions.
- Select the Copy Column Values function.
- Choose the column
English
and add a condition that saysEnglish has Non Empty Values
- Enter
Language
in the new column and hit APPLY. This will create a new column called Language and fill in the values from column English into column language wheresoever it has a value - Open Data Preparation menu and click on Column Function
- Select
Copy Column Values
- Choose the language
French
and add a condition that saysFrench has Non Empty Values
- Select the column
Language
in result section and hit APPLY
note
English
and French
can be removed by deleting columns
The resulting data should now look like below:
Student | Science | Language |
---|---|---|
Alice | 140 | 138 |
Bob | 135 | 145 |
Frank | 122 | 102 |
Judy | 185 | 135 |
Supported Options
This task takes the following inputs:
- Copy from: The column from which you want to copy values from.
- Condition: See Condition
note
You can copy a numeric column or a date column as a text column. This will set the format on the date/numeric columns to as seen currently on the grid. It cannot be edited later and will not reflect even if you change the format.
info
- Result: The result column documentation.
- Date formatting: The date formatter documentation