Unpivot Table
Last updated
Last updated
The Unpivot Table task in Gaio DataOS allows you to transform a wide-format table (with multiple columns representing categories or dates) into a long-format table (where values are stacked into rows). This is especially useful for time series, monthly reports, and dashboards requiring dynamic filtering.
Important: This task can only be used when a table is selected in the flow.
Go to the menu: Tasks > ETL > Unpivot Table
Task label: (optional) Name for identifying this step in your flow.
Result table: Enter the name of the new table that will contain the unpivoted data (e.g., unpivot_table
).
Unpivot columns: Select the columns whose values will be transformed into rows (e.g., January
, February
).
These columns will become the values in a new "category" field, and their corresponding values will move into a single “quantity” column.
Sort values: Choose Ascending
or Descending
if you want to control the order of unpivoted rows by column category.
Extra columns: Select columns that should remain unchanged and be repeated in the resulting unpivoted table (e.g., Region
, Product
).
Position of extra columns: Choose whether they appear At start
or At end
of the result.
Click Save to store the task in your flow.
Click Run to execute the task in your flow.
Use clear numeric fields (e.g., valor
, quantidade
) as the "Value to pivot" to avoid confusion in the resulting quantity
column.
Ensure your column names are correct — in the screenshot, Novemvro
should be corrected to Novembro
.
Always preview the output and validate if your new table preserves the desired relationships.
Convert monthly sales columns into a time series
Normalize survey responses or data from spreadsheets
Simplify data structure for dashboards and filtering
Prepare wide-format datasets for analytical models
Given the configuration shown in the screenshot, the output table will include:
Pay
December
313088.1023
Pay
January
0
Pay
February
0
...
...
...
to receive
October
268242.7913
to receive
November
293688.738
Where:
Tipo
is preserved as an extra column
category
was generated from the selected month columns
quantity
holds the original values