I want to build a QGIS formula where I calculate one attribute from 10 others, and I only need to sum them up.
My Problem is, that I don't get the actual values of the attributes. I thought about using the function: current_value()
which works fine if I build a value relation but is not present in the default value expression builder.
Here my example:
The "RMR-Wert" should be calculated of the upper values (the values in the parentheses are saved to the attribute table and database).
Is there another option than depending on the function: current_value()
?
The Entrys only look like strings in the formula, in the attribute Table they appear as int. This is because I use "Wertabbildung" (Value references (?)):
So the Columns I want to calculate with are all int:
For the Formula I use the Drag and Drop option and it looks like this:
Until now none of the proposed approaches worked for me.
It could be, because the layer i want to alter is a view from a postgres database. Also in the QGIS attribute table the values are displayed as strings:
while in the database they are stored as integers:
Also i can't use a virtual column, because then my QGIS crashes, i guess it's also because its a database view, but not sure about this.
If i want to change my values to int values i get an error message:
evaluation error: not possible to convert "..." to integer (hope thats a propper translation...)
That could be, because in the attribute table the values appear as strings...
My plan now is to move on from QGIS to Postgresql and try to tackle the problem there, using Generated Columns.