EQL supports the following aggregation functions.
MIN and MAX results ordering
MIN
and MAX
functions work with int, double, dateTime, duration, Boolean, and string fields, as follows:
MIN
finds the numerically smallest integer or double, while MAX
finds the largest integer or double.MIN
finds the earliest date while MAX
finds the latest date.MIN
finds the shortest time duration date while MAX
finds the longest time duration. Note that a negative duration is considered to be less than a positive duration.MIN
and MAX
consider FALSE to be less than TRUE (if the data set has both values assigned). If the data set has only Boolean type assigned, then that value is returned by both functions.MIN
would return "89" while MAX
would return "xy".STRING_JOIN function
STRING_JOIN
function takes a string property and a delimiter and creates a single string containing all of the property's values, separated by the delimiter. Its syntax is:
STRING_JOIN('delimiter', string_attribute)
The delimiter is a string literal enclosed in single quotation marks.
The resulting strings are sorted in a lexicographical order within each group. NULL values are ignored in the output, but values having the empty string are not.
R_NAME
attribute is of type string and contains names of regions, while the N_NAME
attribute is also of type string and contains the names of nations:
RETURN results AS SELECT STRING_JOIN(', ',R_NAME) AS Regions, STRING_JOIN(',',N_NAME) AS Nations FROM ProductState 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
Note:
The Regions delimiter includes a space while the Nations delimiter does not. That is, if you want a space between the output terms, you must specify it in the delimiter.