# Creating Expression Columns

You can define an expression for a column, enabling it to contain a value calculated from other column values in the same row or from the column values of multiple rows in the table. To define the expression to be evaluated, use the Expression property of the target column, and use the ColumnName property to refer to other columns in the expression. The DataType for the expression column must be appropriate for the value that the expression returns.

The following table lists several possible uses for expression columns in a table.

Expression type Example
Comparison "Total >= 500"
Computation "UnitPrice * Quantity"
Aggregation Sum(Price)

You can set the Expression property on an existing DataColumn object, or you can include the property as the third argument passed to the DataColumn constructor, as shown in the following example.

workTable.Columns.Add("Total",Type.GetType("System.Double"))

workTable.Columns.Add("Total", typeof(Double));