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:
- Open the Expression Editor where you want to add the expression.
- Enter the following:
AggregateDataSourceColumn( DataSourceName, AggregateFunction, ModelReference );
- Replace DataSourceName with the name of the data source to use.
- 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).
- (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.
- Save the expression.