melt
Transpose certain parts of a table.
Introduction
Use the melt enrichment instruction to transpose all the table columns that are not selected into rows. Enter the name of the column to keep as a column and all other columns are transposed into rows.
Creating the enrichment
For more information on creating an enrichment, see Using custom scripts.
Configuring the enrichment
To configure the enrichment, fill in the following fields. Required fields are marked with an asterisk (*).
-
Key
-
Enter the name of the column that you do not want to be transposed. To keep multiple columns as columns, click
and enter the names of the columns you do not want to be transposed.
-
Variablefield
-
Enter the name for the new column that will contain the original names of the transposed columns.
-
Valuefield
-
Enter the name for the new column that will contain the original values of the transposed columns.
-
Variables
-
If the columns to be transposed contain a subset of variables, enter the names of the variables to transpose. Any columns that are not entered in this field will not be transposed. See Example 2 below.
Example 1
Enrichment configuration
-
Key
-
Campaign
-
Variablefield
-
Transposed columns
-
Valuefield
-
Transposed values
Data table before enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
Brand |
media |
7 |
Brand |
ecommerce |
3 |
Dashboard |
media|social |
18 |
Data table after enrichment
Campaign |
Transposed columns |
Transposed values |
---|---|---|
Brand |
Ad Group |
media |
Brand |
Clicks |
7 |
Brand |
Ad Group |
ecommerce |
Brand |
Clicks |
3 |
Dashboard |
Ad Group |
media|social |
Dashboard |
Clicks |
18 |
Example 2
In this example, the Variable field is populated with the value Clicks
. This means only Clicks column is transposed along with the corresponding values.
Enrichment configuration
-
Key
-
Campaign
-
Variablefield
-
Transposed columns
-
Valuefield
-
Transposed values
-
Variable
-
Clicks
Data table before enrichment
Campaign |
Ad Group |
Clicks |
---|---|---|
Brand |
media |
7 |
Brand |
ecommerce |
3 |
Dashboard |
media|social |
18 |
Data table after enrichment
Campaign |
Transposed columns |
Transposed values |
---|---|---|
Brand |
Clicks |
7 |
Brand |
Clicks |
3 |
Dashboard |
Clicks |
18 |