Functions used in aggregate calculations
This section describes the range of functions that perform aggregate calculations. In Report Studio, you can perform aggregate calculations across the data rows in a group, section, or across an entire report table, as shown in Table 12‑1.
Table 12‑1 Aggregate functions
Aggregate function
Description
AVERAGE
Returns the average, or mean for a set of data rows. For example, if a report column contains values 5, 2, 7, and 10, AVERAGE returns 6.
COUNT
Counts the number of data rows. If a column contains values 5, 2, 7, and 10, COUNT returns 4.
COUNTVALUE
Counts the number of unique values in a set of data rows. If a report column contains values 5, 2, 5, 7, and 10, COUNTVALUE returns 4.
FIRST
Returns the first value in set of data rows. If a report column contains data rows 5, 2, 7, and 10, FIRST returns 5.
LAST
Returns the last value in a set of data rows. If a report column contains data row values 2, 5, 7, and 10, LAST returns 10.
MAX
Returns the largest value in a set of data rows. If a report column contains data row values 5, 2, 7, and 10, MAX returns 10. For string values, MAX returns the last alphabetical value. For date values, MAX returns the latest date.
MEDIAN
Returns the median, or middle value in a set of data rows. If a report column contains values, 5, 2, 7, and 10, MEDIAN returns 6.
MIN
Returns the smallest value in a set of data rows. If a report column contains data row values 5, 2, 7, and 10, MIN returns 2. For string data, MIN returns the first alphabetical value. For date values, MIN returns the earliest date.
MODE
Returns the mode, or the value that occurs most frequently in a set of data rows. If a report column contains values, 5, 2, 5, 7, and 10, MODE returns 5.
QUARTILE
Returns the quartile value in a set of data rows, given a specified quart (0‑4). A quartile can be defined as any three values that divide a set of values into four equal parts, such that each part represents 1/4 of the set of values. MIN, MEDIAN, and MAX return the same value as QUARTILE when quart is equal to 0, 2, and 4, respectively. If a set of data rows contains 50, 75, 80, 90, and 95, and you specify a quart of 2, QUARTILE returns 80.
STDDEV
Returns the standard deviation of a set of data rows. Standard deviation is a statistic that shows how widely values disperse from the mean value. If a set of data rows contains 50, 75, 80, 90 and 95, STDDEV returns 17.536.
SUM
Adds all the values in a set of data rows. If a report column contains 50, 75, 80, 90, and 95, SUM returns 390.
VARIANCE
Returns the variance of a set of data rows. Variance is a statistical measure expressing the size of the differences between the values. The variance increases as the differences between the numbers increase. If a set of data rows contains 50, 75, 80, 90, and 95, VARIANCE returns 307.5. If a set of data rows contains 5, 2, 5, 7, and 10, VARIANCE returns 8.7.
WEIGHTEDAVE
Returns the weighted average value in a set of data rows, given weights specified in another set of values. In a weighted average, each number is assigned a weight or degree of importance. These weights determine the relative importance of each number on the average. Grades are often computed using a weighted average. For example, for a set of scores 50, 75, 80, 90, and 95, with respective weights, 10, 25, 15, 30, and 20, WEIGHTEDAVE returns 81.75.