Reshape a table, transposing fields into data. One line with 5 columns (excl. keys) will result in 5 rows. All fields which are not part of the key will be transposed.
Example

Example Input
dim_A | dim_B | metric_1 |
AAA | DDD | 111 |
BBB | EEE | 222 |
CCC | FFF | 333 |
Example Output
dim_A | new_variable | new_value |
AAA | dim_b | DDD |
AAA | metric_1 | 111 |
BBB | dim_B | EEE |
BBB | metric_1 | 222 |
CCC | dim_B | FFF |
CCC | metric_1 | 333 |
I Ain't Afraid of No Code!
[
[
"melt",
{
"variablefield": "new_variable",
"variables": null,
"valuefield": "new_value",
"subtable": null,
"key": [
"dim_A"
],
"_comment": null
}
]
]
param list key: Defines the fields used as key.
param list variables: Selects a subset of variables.
param str variablefield: Name of new field containing original column name.
param str valuefield: Name of new field containing original value.
Comments
0 comments
Article is closed for comments.