Adds a new field with a fixed value. The position of the new field within the table is set by the Field Index. A Field Index of 0 corresponds to the first position, 1 corresponds to the second position, and so on. To add the field to the last position, change the index to -1.
Example

Example Input
dim_A | dim_B | metric_1 |
AAA | DDD | 111 |
BBB | EEE | 222 |
CCC | FFF | 333 |
Example Output
dim_A | dim_B | NewFieldName | metric_1 |
AAA | DDD | new_value | 111 |
BBB | EEE | new_value | 222 |
CCC | FFF | new_value | 333 |
I Ain't Afraid of No Code!
[
[
"addfield",
{
"index": -1,
"subtable": null,
"field": "NewFieldName",
"value": "new_value",
"_comment": null
}
]
]
param int index: Position of new field (first position = 0).
param str subtable: Name a subtable in which output will be stored (will create subtable where necessary). If you do not want to create a subtable, enter "null".
param str field: Name of the field to be added.
param str value: Static value for new field.
param str comment: A comment that will appear in the Transformation UI.
Comments
0 comments
Article is closed for comments.