mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
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
15 lines
765 B
Plaintext
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"}
|
|
]
|
|
}
|