I am looking for a command, that sums the value of the field "Baulast" if they have the same "ogc_fid" and if there is a Number in the field "WEA". If there is no number in the field "WEA" -> 'keine Baulast'.
Maybe something like
if("WEA">NULL, sum("Baulast","ogc_fid"), 'keine Baulast')
So as seen on the Picture, I want to sum the fields that have same ogc_fid and have a number in "WEA".

"Baulast"field? maybe use thesum(to_int("Baulast"), to_string("ogc_fid")). BTW comparison withNULLshould be done asif("WEA" IS NOT NULL, sum(to_int("Baulast"), to_string("ogc_fid")), 'keine Baulast'), check https://gis.stackexchange.com/questions/203463/what-is-the-difference-between-null-and-is-not-null-in-qgis-filter-expression – Taras Dec 09 '21 at 12:20