Adds an arbitrary column from meta information (column has distinct value for all rows).
Example 1
Example Input 1
Simple field, would extract
Simple field, would extract
{"adverity_client_name":"Tenant#1"}:
dim_A | dim_B | metric_1 |
AAA | DDD | 111 |
BBB | EEE | 222 |
CCC | FFF | 333 |
Example Output 1
dim_A | dim_B | metric_1 | new_field |
AAA | DDD | 111 | Tenant#1 |
BBB | EEE | 222 | Tenant#2 |
CCC | FFF | 333 | Tenant#3 |
Example 2

Example Input 2
Nested Field, would extract
Nested Field, would extract
{"custom_meta_information":{"source_directory":"uploads"}}
:
dim_A | dim_B | metric_1 |
AAA | DDD | 111 |
BBB | EEE | 222 |
CCC | FFF | 333 |
Example Output 2
dim_A | dim_B | New_Field | metric_1 |
AAA | DDD | uploads | 111 |
BBB | EEE | uploads | 222 |
CCC | FFF | uploads | 333 |
I Ain't Afraid of No Code!
Example 1
[
[
"metaaddfield",
{
"index": null,
"subtable": null,
"metaname": "client_name",
"fieldname": "new_field",
"_comment": null
}
]
]
Example 2
[
[
"metaaddfield",
{
"index": 2,
"subtable": null,
"metaname": "custom_meta_information.source_directory",
"fieldname": "new_field",
"_comment": null
}
]
]
param int index: Location index of the new field. Default is None: adds field at the end.
param str subtable: Name a subtable in which output will be stored (will create subtable where necessary).
param str metaname: The source field in meta header. Nested dictionaries can be navigated via ..
param str fieldname: The new field to be created
param str comment: A comment that will appear in the Transformation UI.
Comments
0 comments
Article is closed for comments.