EQL supports the following aggregation functions.
Function | Description |
---|---|
ARB | Selects an arbitrary but consistent value from the set of values in a field. |
AVG | Computes the arithmetic mean value for a field. |
COUNT | Counts the number of records with valid non-NULL values in a field for each GROUP BY result. |
COUNTDISTINCT | Counts the number of unique, valid non-NULL values in a field for each GROUP BY result. |
EVERY | In a Boolean expression, returns TRUE if all values in a field are TRUE, otherwise returns FALSE. |
MAX | Finds the maximum value for a field. |
MIN | Finds the minimum value for a field. |
MEDIAN | Finds the median value for a field (Note that
PAGE PERCENT provides overlapping
functionality).
Note that the EQL definition of
MEDIAN is the same as the normal statistical
definition when EQL is computing the median of an even number of numbers. That
is, given an input relation containing
{1,2,3,4}, the following query:
RETURN results AS SELECT MEDIAN(a) AS med GROUPproduces the mean of the two elements in the middle of the sorted set, or 2.5. |
SOME | In a Boolean expression, returns TRUE if at least one value in a field is TRUE, otherwise returns FALSE. |
STDDEV | Computes the standard deviation for a field. |
STRING_JOIN | Creates a single string containing all the values of a string attribute. |
SUM | Computes the sum of field values. |
VARIANCE | Computes the variance (that is, the square of the standard deviation) for a field. |
STRING_JOIN('delimiter', string_attribute)
The delimiter is a string literal enclosed in single quotation marks.
The resulting strings are sorted in an arbitrary but stable order within each group. NULL values are ignored in the output, but values having the empty string are not.
RETURN results AS SELECT STRING_JOIN(',',R_NAME) AS Regions, STRING_JOIN(',',N_NAME) AS Nations GROUP
Nations ALGERIA, ARGENTINA, BRAZIL, CANADA, CHINA, EGYPT, ETHIOPIA, FRANCE, GERMANY, INDIA, INDONESIA, IRAN, IRAQ, JAPAN, JORDAN, KENYA, MOROCCO, MOZAMBIQUE, PERU, ROMANIA, RUSSIA, SAUDI ARABIA, UNITED KINGDOM, UNITED STATES, VIETNAM Regions AFRICA,AMERICA,ASIA,EUROPE,MIDDLE EAST