AggregateDataSourceColumn
Performs a calculation against a specific data source column and returns the requested value.
Syntax
AggregateDataSourceColumn( DataSourceName, AggregateFunction, ModelReference );
Parameters
Parameter Name | Type | Description | Optional? | Default Value |
---|---|---|---|---|
DataSourceName | String | The name of the data source containing the column to be interrogated. | No | n/a |
AggregateFunction | String | The aggregate function to use. This should include the function name followed by the name of the column in parentheses, as such: SUM(Column). Refer to the Output table below for more information on the available functions. | No | n/a |
ModelReference | String | The model reference associated with the chosen in-memory data source. If the function is called by a model, it assumes the data source exists within that model, so you do not need to specify a reference unless the data source exists in a different model on the same repository. If the function is called outside the context of a model - for example, in a web page expression or via the DATASOURCE element tag - you must specify the model containing the data source. | Yes | "" |
Output
The function will return a different value depending on which aggregate function is used. The following table contains all available parameters for AggregateFunction and what each returns:
Aggregate Function | Description |
---|---|
AVG | Returns the average of all values in the column. |
COUNT | Returns the number of rows in the column. Unlike all other aggregate functions, this will include NULL values. |
MIN | Returns the lowest value in the column. |
MAX | Returns the highest value in the column. |
STDEV | Returns the statistical standard deviation of all values in the column. |
SUM | Returns the combined total sum of all values in the column. |
VAR | Returns the statistical variance of all values in the column. |