Our Foundation is adding additional properties to points.

If property1 = FOO , then add property2 = BAR

        property1 = 'FOO' THEN property2 = 'BAR'

When I run this the property1 column is deleted. Can you help me with the syntax, here, please?

Assumptions/Knowns: This is a spatialite layer. property1 and property2 columns both exist. I am using QGIS 2.4. I opened the attributes tables to use the Expression dialog. The property1 column is selected when the expression is executed. property1 and property2 are columns, and I am aware that " is sometimes used to enclose columns. I do need to store these values for use in other programs where they cannot be so easily derived from the data.

I saw several examples that changed the current value of property1: WHEN property1 = A THEN 1 but this only changes the value in the query column, and I am looking to insert another value property2 based on the value of property1.


Have you checked and selected the correct target field = "property2" for "update selected field"?

enter image description here

no need to set update field in syntax.

try the below syntax.

   WHEN  "property1" = 'FOO' THEN 'BAR'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.