Category: Transform / Advanced
Converts a matrix table into a straight table by rotating columns into "Labels" and "Data" columns. This action is opposite to the Pivot action.
This action is used to convert a cross-table (or matrix) into a straight table. It can be used, for instance, to convert a cross-table from an Excel spreadsheet into a table suitable for exporting into a database.
Setting | Description |
---|---|
Column name for labels | Enter a name for the column that will contain the column header labels from the matrix table. |
Column name for data | Enter a name for the column that will contain the data values from the matrix table. |
Unpivot all columns except these | Select fields that will not be unpivoted, but instead will be repeated down rows, as is, once for each column heading in the matrix table. |
Typically, any columns used for row labels in the source matrix table will be selected under "Unpivot all columns except these" to retain those values as row values in the unpivoted table. Otherwise, those values will be listed in the result table with a "label" equal to the matrix table's column heading for the row labels, and data values equal to the row labels.
Convert the matrix table, below, into a standard data table. Unpivot all column except "Country".
Table 1: Winter Olympics medals
Country | Winter 2010 | Winter 2014 |
---|---|---|
Canada | 26 | 25 |
Norway | 23 | 26 |
Germany | 30 | 19 |
Country | Labels | Data |
---|---|---|
Canada | Winter 2010 | 26 |
Norway | Winter 2010 | 23 |
Germany | Winter 2010 | 30 |
Canada | Winter 2014 | 25 |
Norway | Winter 2014 | 26 |
Germany | Winter 2014 | 19 |
Column name for labels: Labels
Column name for data: Data
Unpivot all columns except these: Country
Convert the matrix table, below, into a standard data table.
Table 1: Winter Olympics medals
Country | Winter 2010 | Winter 2014 |
---|---|---|
Canada | 26 | 25 |
Norway | 23 | 26 |
Germany | 30 | 19 |
Labels | Data |
---|---|
Country | Canada |
Country | Norway |
Country | Germany |
Winter 2010 | 26 |
Winter 2010 | 37 |
Winter 2010 | 30 |
Winter 2014 | 25 |
Winter 2014 | 28 |
Winter 2014 | 19 |
Column name for labels: Labels
Column name for data: Data