I have a line vector layer which has multiple segments within individual polygons in a separate polygon layer. I have spatially joined the attributes so that each line segment now has the same ID as its corresponding polygon.
I need to calculate the lengths of the lines within each polygon according to the polygon ID. Is there an expression I can use to do this? I have already calculated the lengths of the individual segments but I need to get the sum of these according to each unique polygon ID.
I am a novice at complex SQL expressions within QGIS, ideally I would like a new column displaying the info.