I've got a line layer shapefile with lots of values in two columns ("Verstoord" and "Beleid"). I'm trying to fill a third column ("Advies") with values based on the first two columns. This is the code I'm using:
if("Verstoord" = 'ja' OR "Beleid" = '8' OR '9' OR 'Vrij' OR 'Laag' OR 'Geen' OR 'Z5','geen',if("Verstoord" = 'nee' AND "Beleid" = '3' OR 'Z2' OR 'Z3', 'Archeologische begeleiding', if("verstoord" = 'nee' AND "Beleid" = '5' OR '6' OR 'Hoog' OR 'Z4s', 'Verkennend booronderzoek (25 meter)', if("Verstoord" = 'nee' AND "Beleid" = '7' OR 'Middelhoog' OR 'Z5s','Verkennend booronderzoek (50 meter)',"Advies"))))
But it keeps giving the Eval error that certain values, mainly those with letters in them, can't be converted to boolean.
I'm working with QGIS 3.34.10.
I changed the code, and it helped a bit, but not only the first 'if' is executed
if("Verstoord" = 'ja' OR "Beleid" IN ('8', '9', 'Vrij', 'Laag', 'Geen', 'Z5'),'geen',if("Verstoord" = 'nee' AND "Beleid" IN ('3', 'Z2', 'Z3'), 'Archeologische begeleiding', if("verstoord" = 'nee' AND "Beleid" IN ('5', '6', 'Hoog', 'Z4s'), 'Verkennend booronderzoek (25 meter)', if("Verstoord" = 'nee' AND "Beleid" IN ('7', 'Middelhoog', 'Z5s'),'Verkennend booronderzoek (50 meter)',"Advies"))))
"Beleid" = '8' OR "Beleid" = '9'and not"Beleid" = '8' OR '9', however, the best practices encourage to use theIN-operator, i.e."Beleid" IN (8, 9). If the"Beleid"field is of integer type, quotation marks can be skipped9and not'9'.