Skip to main content
name construction
Source Link
JGH
  • 43.1k
  • 3
  • 46
  • 93

You can achieve this using a virtual layer.

It would group the records by civic number + street name (though if you can group by ID do so), union the geometries, sum the area and do the division using this sum.

Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Feel free to add more fields from your layer, and to adjust the names!

SELECT group_concat(name,'_') as new_name,
       st_union(geometry) as geometry, 
       sum(parcel_area) tot_area, 
       min(total_price) as total_price, 
       1.0*min(total_price)/sum(parcel_area) as price_per_area_unit,
       civic_number,
       street_name
FROM myLayer
GROUP BY civic_number, street_name

enter image description hereenter image description here

You can achieve this using a virtual layer.

It would group the records by civic number + street name (though if you can group by ID do so), union the geometries, sum the area and do the division using this sum.

Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Feel free to add more fields from your layer, and to adjust the names!

SELECT st_union(geometry) as geometry, 
       sum(parcel_area) tot_area, 
       min(total_price) as total_price, 
       1.0*min(total_price)/sum(parcel_area) as price_per_area_unit,
       civic_number,
       street_name
FROM myLayer
GROUP BY civic_number, street_name

enter image description here

You can achieve this using a virtual layer.

It would group the records by civic number + street name (though if you can group by ID do so), union the geometries, sum the area and do the division using this sum.

Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Feel free to add more fields from your layer, and to adjust the names!

SELECT group_concat(name,'_') as new_name,
       st_union(geometry) as geometry, 
       sum(parcel_area) tot_area, 
       min(total_price) as total_price, 
       1.0*min(total_price)/sum(parcel_area) as price_per_area_unit,
       civic_number,
       street_name
FROM myLayer
GROUP BY civic_number, street_name

enter image description here

Source Link
JGH
  • 43.1k
  • 3
  • 46
  • 93

You can achieve this using a virtual layer.

It would group the records by civic number + street name (though if you can group by ID do so), union the geometries, sum the area and do the division using this sum.

Go to the menu Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query. Feel free to add more fields from your layer, and to adjust the names!

SELECT st_union(geometry) as geometry, 
       sum(parcel_area) tot_area, 
       min(total_price) as total_price, 
       1.0*min(total_price)/sum(parcel_area) as price_per_area_unit,
       civic_number,
       street_name
FROM myLayer
GROUP BY civic_number, street_name

enter image description here