Adding Columns to a Query

Understanding How SAS Visual Data Builder Works with Columns

By default, 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 for the query.
You need to add the columns to the query that you want to use as input. Once the columns are added, you can specify column expressions, aggregations, and use the pivot by feature.
Note: As an exception, the auto-aggregate feature requires that you set the default aggregations for the table before you add columns from the table.
When a data source is dropped on 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.

Adding All the Columns from a Table

To add all the columns from a table to a query, select the table on 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 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, the Column Name field has a number added to the name. If you change the name, make sure that you do not leave more than one column with the same name.

Adding a New Column Manually

To add a new column manually:
  1. Select 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.