<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>At the moment an array or map data structure in an expression can only be created by using the array() and map() constructor function where one has to explicitly include all the values at the creation of the data structure. Arrays can also be created from strings with the string_to_array function. </p>
    <p>Wouldn't it be useful if the arrays could be created by an aggregate function and in particular the relation_aggregate function (esp. useful for analyzing 1:n relations)?</p>
    <p>Something like:
aggregate(layer:='countries', aggregate:='array', expression:="area") --> array with all areas of the countries</p>
    <p>or</p>
    <p><style type="text/css">
p, li { white-space: pre-wrap; </style>relation_aggregate(relation:='cities_in_countries',aggregate:='array', calculation:="towns") --> array with all towns that are related to a country.</p>
    <p>---------------</p>
    <p>Similar for maps:</p>
    <p>aggregate(layer:='countries', aggregate:='map', expression:="area", mapAttributes:="area, population") --> nested maps with all areas and population per country.</p>
    <p>or</p>
    <p>relation_aggregate(relation:='cities_in_countries',aggregate:='map', 
mapAttributes:="town_name,town_population") --> array with all town attributes that are related to a country.</p>
    <p>Any thoughts?</p>
    <p>Andreas
</p>
  </body>
</html>