Adding Columns to a Query

Understanding How SAS Visual Data Builder Works with Columns

When you add a data source (a table or subquery) to the workspace, the columns from the data source are not automatically added as output columns to the query.
You need to add the columns to the query that you want to use as input. After the columns are added, you can specify column expressions and aggregations and use the sort and pivot by features.
Note: As an exception, the auto-aggregate feature requires that you set the default aggregations for the table before they are added to the query.
When a data source is dropped onto the workspace, the column types are represented by the following icons:
Icons for Data Types
Icon
Description
Numeric type
This icon represents numeric data.
Character type
This icon represents character data.
Note: Date, time, and datetime data use this icon. After the column is added, the Type and Format columns are updated with information about the new column.

Adding All of the Columns from a Table

To add all of the columns from a table to a query, select the table in the workspace, right-click, and select Add All Columns.
Add All Columns
Adding all columns from a table

Adding a Single Column from a Table

To add one column from a table to a query, select the column name with your pointer.
Add One Column
Add One Column
Tip
If you select the column name an additional time, the column is added to the query again. This can be helpful if you want to use a column for both numeric and character data. When you add a column more than once, a number is added to the column name. If you change the column name, make sure that you do not have more than one column with the same name.

Adding a New Column Manually

To add a new column manually:
  1. Click the Column Editor tab.
  2. Click Add at the bottom of the table.
  3. Specify values for the Column Name, Expression, and Type fields. The remaining fields are optional.