Data Cleaning Exercises

Reference · Visual workspace

Unpivot wide data to long in Visual workspace

Turn several columns into key/value rows, without inventing rows for missing values.

When to use it

Survey or spreadsheet exports with one column per question or period.

How

Add step → Reshape → Unpivot. Tick the columns to keep and the columns to turn into rows, and name the new key and value columns. Then filter out rows with a missing value if absent answers shouldn't be rows.

Unpivot 3 columns into question/score
  • The unpivoted columns must share one type; convert them first.

Pitfalls

  • Scoring missing answers as 0.
  • Mixing types in the unpivoted columns.

Lesson: Unpivot without inventing scores

Practise it: Unpivot survey answers without inventing scores