I created a layer to visualize cable-laying and want to export the sum of the cable-lengths to an excel file when I'm done so i created an attribute for it.

How do I link an attribute to the auto-calculated $length?

I am using QGIS 3.0


I added an attribute with the open-field-calculator and was able to set the formula round($length,2) to get the length as an output.

Adding it through the layer-properties didn't save the formula and just set the length for already existing attributes. Now every new added attribute automatically gets a length-value.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.