Data can be organized into tables in different ways. In this lesson, you will learn to recognize “long” and “wide” formats and convert from one to the other, which is called reshaping.
Long format tables contain only one column with measured values, in this case Count of incidents. All other columns are variables that describe what is measured.
Each row is a unique measurement. In this case, each unique of Complaint date is combined with each unique Borough.
In a wide format table, the same data is organized differently. There can be one or more columns of measurements, and what is being measured is described by the column names.
Once you understand how you want your table to be formatted, reshaping takes only a few steps:
Reshape from Long to wide
Add the Reshape step and select
Long to wide
Select Row variables (the data you want to display in red, in the example above). You can select up to two of them.
Select the column variable (the data you want to display in yellow, in the example above, in the header).
From wide to long
Add the Reshape step and select W
ide to long
Select one Row variable (the data you want to display in red, in the example above). New variable columns and a value column will be created.