Columns To Rows

Columns to Rows allows the data conversion from wide format to long format. In other words, it allows the stacking of multiple column values into a single column.

Table of Contents

Quick Start

Let us look at the following sample data:

Table 8 Population by Country By Year (Wide Format)

Country

2000

2005

2010

China

1,242,612,300

1,307,593,000

1,339,724,852

India

1,040,000,000

1,103,371,000

1,182,105,564

United States

281,421,923

295,520,000

309,349,689

The same data can also be represented in the following format:

Table 9 Population by Country By Year (Long Format)

Country

Year

Population

China

2000

1,242,612,300

China

2005

1,307,593,000

China

2010

1,339,724,852

India

2000

1,040,000,000

India

2005

1,103,371,000

India

2010

1,182,105,564

United States

2000

281,421,923

United States

2005

295,520,000

United States

2010

309,349,689

The first format of representation of data is called the wide format since the years in the data are distributed across the columns. The second format is called the long format because the years in the data are distributed across the rows. where each year of data is in a separate observation. Data in the long format is easier to use for some types of analysis.

If the data is in long format:

  1. You can rank values within each category and see them in relation to one another.

  2. Filter easily across different categories.

  3. Create summary more easily by grouping or crosstabing the data.

The Columns to Rows task can convert wide format to long format by completing the following steps:

  1. Go to Transform > Reshape, Group & Aggregate.

  2. Click on the Columns To Rows option.

  3. Select all the columns that you want to convert from wide format to long format.

  4. Name the Label and Value columns appropriately.

  5. Click APPLY.

Supported Options

The following options are supported:

  1. Column Selection: You can select the columns that you want to convert to long format. You can tweak the labels attached to each column. Only the columns of matching types can be stacked and the resulting value column produced also has the same type.

  2. Label: The name of the column where all the labels are stacked.

  3. Value: The name of the column where all the column values are stacked.