Unpivot Function

The Unpivot Node allows you to rotate columns into rows. In other words, by unpivoting your table you will rotate values from multiple unique columns into a single column with category values and a supporting columns which summarize the data for each unique row from the new unpivot column. 

For instance, you can use the Unpivot node on a table that looks like the following and restructure its data and granularity, summarizing the data in a more "vertical" way:

Screenshot_2021-10-19_at_17.22.15.png

 

Now we get at a table that looks like the following, in which the columns for each of the different shops become a single column called "shop" and its unique values are the shop names - the names of the previously existing columns:

Screenshot_2021-10-19_at_17.24.06.png

Note: In order to use the Model feature you already should have already imported data sources into Y42.

Setting up your Unpivot Node

  • Click on the Unpivot Node to apply the settings. 

    Screenshot_2021-10-19_at_17.24.55.png

  • Continue by writing on Target Column the name of the new column you will create combining the columns rotated into rows.
  • Then choose the name for the Unpivot Columns, the metric or value that will be aggregated to each newly created row.
  • On Group Value, if you have more than one unpivot column, you can flag them apart by giving each group a different name.
  • Select now on Group Columns the columns that will fall into the Target Column as rows.

To illustrate better these node settings, take the following setup as an example - used to achieve the use case in the beginning of this article:
Screenshot_2021-10-19_at_17.24.20.png

Once you're done with this transformation, you can either perform further transformations or, if you want to export the new data table, click Commit Model.

Was this article helpful?
0 out of 0 found this helpful