Aggregate functions
Aggregate functions enable users to perform mathematical operations on data from within their queries. The IBM® Product Master query language provides five aggregate functions that enable you to perform quick mathematical operations on search attributes. The query language also provides the group by clause to group results displayed by an aggregate function based on one or more search attributes.
The search attribute that is used by the avg()
, max()
,
min(
, and sum()
functions must be a numeric type of indexed
spec-driven attribute. Product Master has the
following types of numeric attributes: Currency, Integer, Number, Number enumeration, and Sequence.
The search attribute that is used by the count()
function must be a named attribute
or an indexed spec-driven attribute. The search attribute that is used by the group by clause must
be a named attribute or an indexed spec-driven attribute.
- Avg() function
- The
avg()
function is used to compute the average value of a search attribute. - Max() function
- The
max()
function is used to find the maximum value of a search attribute. - Min() function
- The
min()
function is used to find the minimum value of a search attribute. - Sum() function
- The
sum()
function is used to compute the sum of values of a search attribute. - Count() function
- The
count()
function is used to count the number of rows that are defined by a search attribute. The count (*) function is used to count all rows in the result set of a query.Important: To use this function with asterisk*
specify the where clause else specify column_name instead of asterisk*
, for examplecount(column_name)
.