Nyall Dawson 2e5257372b [FEATURE] Add order by support to expression aggregate and concatenation functions
Because certain aggregates and concatenation requires results in
a certain order, this change allows specific control of the order
features are added to the aggregate during an expression evaluation.

E.g.

concatenate("Station",concatenator:=',', order_by:="Station")

will give a comma separated list of station names in alphabetical
order, rather than layer feature order.

Sponsored by SMEC/SJ
2019-05-10 06:23:56 +10:00

15 lines
765 B
Plaintext

{
"name": "array_agg",
"type": "function",
"description": "Returns an array of aggregated values from a field or expression.",
"arguments": [
{"arg": "expression", "description": "sub expression of field to aggregate"},
{"arg": "group_by", "optional": true, "description": "optional expression to use to group aggregate calculations"},
{"arg": "filter", "optional": true, "description": "optional expression to use to filter features used to calculate aggregate"},
{"arg": "order_by", "optional": true, "description": "optional expression to use to order features used to calculate aggregate"}
],
"examples": [
{ "expression": "array_agg(\"name\",group_by:=\"state\")", "returns":"list of name values, grouped by state field"}
]
}