In QGIS, I have a column separated by comma (shown by column "lengths"
). I want to sum up elements in it for each row. The column is a text field string.
QGIS – Summing Numbers Separated by Commas in String Field
fields-attributesqgisstringsummarizing
Best Answer
You can use arrays in fieldcalculator for this:
array_sum()
available since QGIS 3.18)To catch errors on invalid "numbers", you can use
try()
: