Skip to main content

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

Open 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 person

Correct pattern

id,month,value with Jan and Feb represented as rows

A safe repair workflow

  1. 1Select the columns that uniquely identify each source row.
  2. 2Choose the measure columns to unpivot.
  3. 3Name the new variable and value fields clearly.
  4. 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