Help Centre › Building Processes
Unpivot (melt) wide-format columns into long format on a new sheet.
Runs on: macOS and Windows only.
Add it to a process
In the process designer, open the Add step tab. Find Unpivot columns under Excel › Columns, or type its name in the search box, and drag it onto the canvas.
Fields
| Field | Required | What it does |
|---|---|---|
| File path | No | Enter the file path, or use a variable such as {folders::desktop::path}\file.xlsx. Leave blank to use the workbook an earlier step opened. |
| Sheet | Yes | Name of the sheet in the Excel file. Supports wildcards: * matches any characters. |
| ID columns | Yes | The columns to keep on every row (one per line), by heading or column letter. Headings match with spaces trimmed. |
| Columns to unpivot | No | Which columns to turn into rows: a range such as G:AD, or headings or letters one per line. Leave blank to use every column that is not an ID column. |
| Columns per item | No | How many side-by-side columns belong together. Use 2 when each amount column is followed by its invoice-number column. Columns are paired by position, not by name. |
| Variable column name | No | Name for the new column that holds each item's source header, trimmed (default: Variable) Default: Variable. |
| Value column name | No | Name for the new value column (default: Value). With 2 or more columns per item, give one name per column, comma-separated, e.g. Amount, Invoices. Default: Value. |
| Destination sheet | No | Name of the new sheet for the unpivoted data. If blank, a default name is used. |
| Skip empty items | No | Leave out items whose cells are all blank, or whose amount is 0 with nothing else filled in. |
| Keep rows with no items | No | When empty items are skipped, still keep one row (ID columns only) for a source row that has no items, so no row disappears unseen. |
See all Excel steps.
Example
With ID columns: "Product"
| Before (wide format) | |||
|---|---|---|---|
| Product | Jan | Feb | Mar |
| Widget | 100 | 150 | 200 |
| Gadget | 80 | 90 | 110 |
| After (long format) | ||
|---|---|---|
| Product | Variable | Value |
| Widget | Jan | 100 |
| Widget | Feb | 150 |
| Widget | Mar | 200 |
| Gadget | Jan | 80 |
| Gadget | Feb | 90 |
| Gadget | Mar | 110 |
Tips
- This is the reverse of a pivot table – use it to normalise data for databases or reporting tools
- List all columns that should stay as-is (identifiers) in the ID columns field – everything else gets melted
- Common use case: converting monthly columns (Jan, Feb, Mar…) into rows with a Month column