Performing a Calculation Against a Data Source Column

The AggregateDataSourceColumn function can be used to perform a calculation against a single column in a data source. For example, you could return the highest or lowest value in the column, or calculate the average value of the entire column.

Implementation:

  1. Open the Expression Editor where you want to add the expression.
  2. Enter the following:

AggregateDataSourceColumn( DataSourceName, AggregateFunction, ModelReference );

  1. Replace DataSourceName with the name of the data source to use.
  2. Replace AggregateFunction with the aggregate function to use. This should include the function name followed by the name of the column in parentheses, as such: SUM(ColumnName).
  3. (Optional) Replace ModelReference with the reference for the model associated with the data source. This is only required if this function is called outside the context of a model, such as in a web page expression.
  4. Save the expression.