Recast molten data. This is the inverse operation of melt. With every recast operation, exactly one column’s values are used for new fields. If multiple values exist under a given key and variablefield, then a list of these values will be created. Any field that is not listed in key, variablefield, or valuefield, will be dismissed.
Example
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 |
dim_A | dim_B | metric_1 |
AAA | DDD | 111 |
BBB | EEE | 222 |
CCC | FFF | 333 |
I Ain't Afraid of No Code!
[
[
"recast",
{
"samplesize": 1000,
"key": [
"dim_A"
],
"valuefield": "new_value",
"variablefield": "new_variable",
"subtable": null,
"reducers": null,
"_comment": null
}
]
]
param int samplesize: Samplesize to define new field names out of ‘variablefield’. This might be useful for large sets of data or ordered variablefield.
param list key: Defines the fields used as key.
param str valuefield: Values in this field will be used as values for new fields.
param str variablefield: Distinct values of this field will be used as new field names.
param str subtable: Name a subtable in which output will be stored (will create subtable where necessary).
param str reducers: Expression to reduce lists of values in a single cell.
param str missing: Custom string missing values for variablefield or valuefield will be padded with.
param str comment: A comment that will appear in the Transformation UI.
Comments
0 comments
Article is closed for comments.