Make Columns tool

Make Columns Tool

Version:
Current
Last modified: January 03, 2020

This is a Laboratory tool and isn't for use in production. It may have documented known issues, may not be feature complete, and is subject to change.

The Make Columns tool takes rows of data and arranges them by wrapping records into multiple columns. The user can specify how many columns to create and whether they want records to layout horizontally or vertically.

This tool is useful for reporting or display purposes where you want to layout records to fit nicely within a table. Instead of showing a list of 50 records, you may want to wrap those records into a table of 5 columns and 10 rows, for example.

Configure the tool

  1. Number of columns: Specify the number of columns to create. For each existing field, a new column will be created with a "Column_#" pre-pended to the column name.
    • If the input contains two fields and you specify two columns (with no group specification), four columns come out of the tool.
    • If the input contains two fields and you specify two columns in addition to one group field, three columns come out of the tool.
  2. Choose to arrange records horizontally or vertically:
    • Arrange Horizontally: Designer orders records by their incoming position and populates cells from left to right until it fills the user-specified number of columns.  After that, Designer wraps records to the next row and continues arranging them from left to right.
    • Arrange Vertically: Designer orders records by their incoming position and populates cells from top to bottom in rows. Designer wraps to the specified number of columns. If there isn't an exact match of records, [Null] values fille the set.
  3. Grouping Fields (Optional): This setting is optional. When a group field is specified, records are sorted by the Group value and arranged according to their incoming record position across columns for the particular group.

Examples

Ungrouped

Input data stream
Food

Apple

Banana
Cherry
Date
Asparagus
Broccoli
Carrot
Daikon
Arrange horizontally
Column_1_Food Column_2_Food
Apple Banana
Cherry Date
Asparagus Broccoli
Carrot Daikon
Arrange vertically
Column_1_Food Column_2_Food
Apple Asparagus
Banana Broccoli
Cherry Carrot
Date Daikon

Grouped

Input data stream
Group Food
Fruit Apple
Fruit Cherry
Fruit Banana
Fruit Date
Vegetable Asparagus
Vegetable Carrot
Vegetable Broccoli
Vegetable Daikon
Arrange horizontally
Group Column_1_Food Column_2_Food
Fruit Apple Banana
Fruit Cherry Date
Vegetable Asparagus Broccoli
Vegetable Carrot Daikon
Arrange vertically
Group Column_1_Food Column_2_Food
Fruit Apple Cherry
Fruit Banana Date
Vegetable Asparagus Carrot
Vegetable Broccoli Daikon

 

Was This Helpful?

Need something else? Visit the Alteryx Community or contact support.