How to unpivot a table
Start with CSV, TSV, TXT, XLSX, or XLS data. Unpivot Table keeps the fields in Identifier Columns on each output record and turns the fields in Columns to Unpivot into attribute/value pairs. Set the output names, decide how blank cells should appear, then inspect and export the records.
Steps to convert wide data to long format
- Paste data into Paste CSV/TSV data, or drop a file into the upload area. You can also choose browse files.
- Keep First row is a header checked when the first row contains field names.
- Use the +ID control to assign row-identifying fields to Identifier Columns. Use +Value for fields that should become records in Columns to Unpivot.
- Set Attribute column name, Value column name, and Blank value display. Enable Skip blank values (omit their records) when empty cells should produce no record.
- Review Unpivoted records preview, then select Export CSV or Export Spreadsheet.
What unpivot columns become
Each source row and each selected value column creates one output row. The tool copies identifier values, writes the source header to the attribute column, and writes the source cell to the value column. For example:
name,Q1,Q2
East,1200,1300
name,Attribute,Value
East,Q1,1200
East,Q2,1300
The default output fields are Attribute and Value. Change those labels to change the output header. Source column names and cell contents stay as supplied, and the transformation does not aggregate records.
How blank values and duplicate headers work
The blank check trims each cell first, so a cell containing only spaces counts as blank. A blank cell creates a record by default, using the text in Blank value display. Enable Skip blank values (omit their records) to leave that record out.
Duplicate headers stay separate by column position. The picker labels later copies with suffixes such as (#2) and (#3); the attribute in the result keeps the original header text.
CSV, TSV, and spreadsheet input
For pasted text and text files, the first line determines comma or tab parsing by comparing delimiter counts. The page has no delimiter control. XLSX and XLS files use the first worksheet. If First row is a header is unchecked, fields receive names such as Column 1 and Column 2.
When a loaded text file exceeds 300,000 characters, the textarea shows a shortened copy while the full file text remains available for the transformation. Empty input does not load fields. A result also needs at least one field in Columns to Unpivot.
Preview and export details
Unpivoted records preview shows the first 2,000 result records. When more exist, the notice above the table reports that only the first records are displayed, while both export controls include the full result. The page sends no request containing the table data. Spreadsheet export needs the XLSX library; use Export CSV if the library fails to load.
Where this comes up
- A reporting table has one column for each quarter, such as
Q1andQ2. Keep the region in Identifier Columns so it stays beside each quarter record. - A survey export stores one response type per column. Put those fields in Columns to Unpivot so each output row has one attribute and one value.
- A workbook contains repeated header text in separate positions. Assign those columns individually and use the picker suffixes to distinguish them.
When another table transform fits better
Dataset Transform Tools includes related reshaping tasks. Choose Pivot Table Generator when records should be grouped and a value field aggregated with count, sum, average, minimum, or maximum. Choose Rename Columns when headers need an explicit old-to-new mapping and cell values must stay in place. Choose Transpose Table when rows and columns should swap without creating attribute/value records.
Frequently asked questions
How do I unpivot wide data into long format?
Paste or upload the table, place row identifiers in Identifier Columns, and assign the fields to reshape to Columns to Unpivot. The preview updates when those assignments or output options change.
What are Identifier Columns in an unpivot table?
Identifier Columns are copied into every output record made from the same source row. A customer ID, region, or date stays beside each generated attribute and value.
How does Unpivot Table handle blank cells?
Blank cells produce a record using Blank value display unless Skip blank values (omit their records) is enabled. Cells containing only spaces count as blank.
Can I unpivot a CSV with duplicate column names?
Yes. Each duplicate header stays a separate field by position, with picker labels such as (#2) and (#3). The output attribute uses the original header text.