I have one table containing many columns. Using the Field Calculator, I want to create a new column containing (for each line) the sum of all columns values.
I cannot find the correct expression to do this sum.
I have one table containing many columns. Using the Field Calculator, I want to create a new column containing (for each line) the sum of all columns values.
I cannot find the correct expression to do this sum.
Using the Field calculator to:
sum up columns without NULL
values:
"column1" + "column2" + "column3"
sum up columns with NULL
values:
"column1" + (CASE WHEN "column2" IS NOT NULL THEN "column2" ELSE 0 END) + "column3"
Make sure the columns are integer or float values.