ColumnAdd

The ColumnAdd verb adds a column to a data source.

Its user interface equivalent is the Insert Column command on the Edit menu.

For more information about creating columns, see ColumnMake.

The syntax is as follows:

ColumnAdd objCol [DataSource objDataSource] 
Origin origin Offset offset [colopts]

Argument

Description

ColumnAdd objCol

Creates the column objCol. objCol must be the object name, and can include the object identifier.

DataSource objDataSource

Places the column within a data source. objDataSource can be the data source object name, object identifier, or both.

Origin origin

Specifies the origin. origin must be one of Source, Generated, Calculated, or Manual. This argument is mandatory.

Offset offset

Specifies the amount by which the column is offset. offset can be 0 or greater. This argument is mandatory.

colopts

Parameters that describe the column in greater detail. All are optional except Column objCol, which is mandatory. Some options are set by default if you do not set them. For the complete list of options, see colopts.

Example

This example adds the Branch Code column to the model.

ColumnAdd "Branch Code" DataSource "All Staff Count (Excel)" Origin Source
Offset 1 Column "Branch Code"