reshape-wide-to-long adaptor transforms a datatable to a two-column datatable in which one column contains the column names of the original datatable and the second column is the respective value from each row.
data
Type: datatable
Required: Yes
The datatable in wide format.
static columns
Type: list
Required: No
The list of columns which will not be reshaped. If unspecified, all columns will be reshaped
key column name
Type: text
Required: No
The name of the column to which keys are added. If unspecified, defaults to key.
value column name
Type: text
Required: No
The name of the column to which values are added. If unspecified, defaults to value.
data
Type: datatable
A datatable in long format.
Example 1: Default behaviour.
data:
static columns: null (empty)
key column name: null (empty)
value column name: null (empty)
data:
-> Transformed all the columns in the datatable, from wide to long, using the default key and value as the column names
Example 2: Reshape with static columns.
data:
static columns:
key column name: null (empty)
value column name: null (empty)
data:
-> Transformed the columns id and code in the datatable, from wide to long, using the default key and value as the column names. The country column was not reshaped.
Example 3: Reshape with specific key column name and value column name.
data:
static columns:
key column name: name
value column name: result
data:
-> Transformed the columns id and code in the datatable, from wide to long, using the name as key column name and result as the value column name.