EXAMPLE - Nest Columns into Objects
This section provides a simple example of nesting columns into a new column of Object data type.
Source:
In the following example, furniture product dimensions are stored in separate columns in cm.
Category | Name | Length_cm | Width_cm | Height_cm |
---|---|---|---|---|
bench | Hooska | 118.11 | 74.93 | 46.34 |
lamp | Tansk | 30.48 | 30.48 | 165.1 |
bookshelf | Brock | 27.94 | 160.02 | 201.93 |
couch | Loafy | 95 | 227 | 83 |
Transformation:
Use the nest
transform to bundle the data into a single column.
Transformation Name | |
---|---|
Parameter: Columns | Length_cm,Width_cm,Height_cm |
Parameter: Nest columns to | Object |
Parameter: New column name | 'Dimensions' |
Results:
Category | Name | Length_cm | Width_cm | Height_cm | Dimensions |
---|---|---|---|---|---|
bench | Hooska | 118.11 | 74.93 | 46.34 | {"Length_cm":"118.11","Width_cm":"74.93","Height_cm":"46.34"} |
lamp | Tansk | 30.48 | 30.48 | 165.1 | {"Length_cm":"30.48","Width_cm":"30.48","Height_cm":"165.1"} |
bookshelf | Brock | 27.94 | 160.02 | 201.93 | {"Length_cm":"27.94","Width_cm":"160.02","Height_cm":"201.93"} |
couch | Loafy | 95 | 227 | 83 | {"Length_cm":"95,"Width_cm":"227","Height_cm":"83"} |