Wide-table problem
Unpivot a Wide CSV into Tidy Rows
Convert repeated month, measure or category columns into key-value rows while preserving identifier columns and missing values.
Use the matching tool
Unpivot / Melt
What the error actually means
Wide exports often place one period or measure in each column. Unpivoting keeps stable identifier columns and turns the repeated headers into a variable column with their cells in a value column. The key decision is which columns identify a record.
Likely causes
- Months or survey questions are stored as separate columns.
- An analysis tool expects tidy long-form data.
- Identifier columns were accidentally included among measures.
- Blank measure cells need an explicit retention policy.
Wide to long
Problem
id,Jan,Feb with one row per personCorrect pattern
id,month,value with Jan and Feb represented as rowsA safe repair workflow
- 1Select the columns that uniquely identify each source row.
- 2Choose the measure columns to unpivot.
- 3Name the new variable and value fields clearly.
- 4Decide whether blank measures should produce rows.
How to verify the result
A file that downloads successfully is not automatically a correct file. Check the result at both the structural and business-data levels:
- Identifiers repeat correctly.
- The expected number of long rows is produced.
- Variable labels match source headers.
- Totals by identifier reconcile.
Read the deeper guides
How to Transpose CSV Data Without Losing the HeadersSwap CSV rows and columns in Excel, Python, or a browser, with practical checks for headers, uneven rows, data types, and file-size limits.How to Prepare CSV Files for Python PandasPrepare CSV files for reliable pandas imports by making encoding, delimiters, nulls, dates, identifiers, and column types explicit.